Ejemplo n.º 1
0
 /**
  * Process body classes, add to page configuration from scheduled structure
  *
  * @param \Magento\Framework\View\Page\Config\Structure $pageStructure
  * @return $this
  */
 protected function processBodyClasses(Structure $pageStructure)
 {
     foreach ($pageStructure->getBodyClasses() as $class) {
         $this->pageConfig->addBodyClass($class);
     }
     return $this;
 }
Ejemplo n.º 2
0
 public function testProcessRemoveAssets()
 {
     $assetName1 = 'test1';
     $assetAttributes1 = ['attr1_1', 'attr1_2'];
     $assetName2 = 'test2';
     $assetAttributes2 = ['attr2_1', 'attr2_2'];
     $expected = [$assetName1 => $assetAttributes1];
     $this->structure->addAssets($assetName1, $assetAttributes1);
     $this->structure->addAssets($assetName2, $assetAttributes2);
     $this->structure->removeAssets($assetName2);
     $this->structure->processRemoveAssets();
     $this->assertEquals($expected, $this->structure->getAssets());
 }
Ejemplo n.º 3
0
 /**
  * Set metadata
  *
  * @param \Magento\Framework\View\Page\Config\Structure $pageConfigStructure
  * @param \Magento\Framework\View\Layout\Element $node
  * @return void
  */
 private function setMetadata($pageConfigStructure, $node)
 {
     if (!$node->getAttribute('name') && $node->getAttribute('property')) {
         $metadataName = $node->getAttribute('property');
     } else {
         $metadataName = $node->getAttribute('name');
     }
     $pageConfigStructure->setMetaData($metadataName, $node->getAttribute('content'));
 }
Ejemplo n.º 4
0
 /**
  * Process all element attributes
  *
  * @param \Magento\Framework\View\Page\Config\Structure $pageStructure
  * @return $this
  */
 protected function processElementAttributes(Structure $pageStructure)
 {
     foreach ($pageStructure->getElementAttributes() as $element => $attributes) {
         foreach ($attributes as $name => $value) {
             $this->pageConfig->setElementAttribute($element, $name, $value);
         }
     }
     return $this;
 }