Exemplo n.º 1
0
 public function testGetOptions()
 {
     $this->rawLayout->add('root', null, 'root', ['root_option1' => 'val1']);
     $this->rawLayout->setProperty('root', RawLayout::RESOLVED_OPTIONS, ['root_option1' => 'val1', 'id' => 'root']);
     $this->rawLayout->add('header', 'root', 'header', ['header_option1' => 'val1']);
     $this->rawLayout->setProperty('header', RawLayout::RESOLVED_OPTIONS, ['header_option1' => 'val1', 'id' => 'header']);
     $this->block->initialize('header');
     $this->assertEquals(['header_option1' => 'val1', 'id' => 'header'], $this->block->getOptions());
     $this->assertEquals(['root_option1' => 'val1', 'id' => 'root'], $this->block->getParent()->getOptions());
 }
Exemplo n.º 2
0
 /**
  * Finishes the building of the block view
  *
  * @param BlockView $view
  * @param string    $id
  */
 protected function finishBlockView(BlockView $view, $id)
 {
     $blockType = $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true);
     $options = $this->rawLayout->getProperty($id, RawLayout::RESOLVED_OPTIONS, true);
     $types = $this->typeHelper->getTypes($blockType);
     // point the block view state to the current block
     $this->block->initialize($id);
     // finish the view
     foreach ($types as $type) {
         $type->finishView($view, $this->block, $options);
         $this->registry->finishView($type->getName(), $view, $this->block, $options);
     }
 }