Beispiel #1
0
 /**
  * add a handle. if $handle parameter implements HandleInterface, $priority
  * will be ignored
  *
  * @param string|HandleInterface $handle
  * @return LayoutManager
  */
 public function addHandle($handle, $priority = 1)
 {
     if (is_string($handle)) {
         $handle = new Handle($handle, $priority);
     }
     $this->updater->addHandle($handle);
     return $this;
 }
 /**
  * Callback handler invoked when the dispatch error event is triggered.
  *
  * @param EventInterface $event
  * @return void
  */
 public function injectErrorHandle(EventInterface $event)
 {
     $this->updater->addHandle(new Handle($event->getError(), 666));
 }
 public function testAnotherHandle()
 {
     $this->updater->addHandle(new Handle('another-handle', 1));
     $this->assertEquals(['blocks' => ['header' => [], 'footer' => [], 'widget1' => []]], $this->updater->getLayoutStructure()->toArray());
 }
Beispiel #4
0
 /**
  * @inheritDoc
  */
 public function addHandle(HandleInterface $handle)
 {
     $this->updater->addHandle($handle);
     return $this;
 }