当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Core_Model_Layout::generateBlocks方法代码示例

本文整理汇总了PHP中Mage_Core_Model_Layout::generateBlocks方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Layout::generateBlocks方法的具体用法?PHP Mage_Core_Model_Layout::generateBlocks怎么用?PHP Mage_Core_Model_Layout::generateBlocks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Core_Model_Layout的用法示例。


在下文中一共展示了Mage_Core_Model_Layout::generateBlocks方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: generateBlocks

 public function generateBlocks($parent = null)
 {
     if (empty($parent)) {
         $parent = $this->getNode();
     }
     if (isset($parent['ifconfig']) && ($configPath = (string) $parent['ifconfig'])) {
         if (!Mage::getStoreConfigFlag($configPath)) {
             return;
         }
     }
     parent::generateBlocks($parent);
 }
开发者ID:vesviet,项目名称:dellocal,代码行数:12,代码来源:Layout.php

示例2: generateBlocks

 /**
  * Create layout blocks hierarchy from layout xml configuration
  *
  * @param Mage_Core_Model_Layout_Element|null $parent
  */
 public function generateBlocks($parent = null)
 {
     if ($parent instanceof Mage_Core_Model_Layout_Element) {
         // This prevents processing child blocks if the parent block fails a conditional check
         if (!$this->checkConditionals($parent)) {
             return;
         }
         // This is handled here so it catches 'block' and 'reference' elements
         $this->processOutputAttribute($parent);
     }
     parent::generateBlocks($parent);
 }
开发者ID:aoepeople,项目名称:aoe_layout,代码行数:17,代码来源:Layout.php

示例3: testGenerateXmlAndBlocks

 /**
  * @covers Mage_Core_Model_Layout::getAllBlocks
  * @covers Mage_Core_Model_Layout::generateBlocks
  * @covers Mage_Core_Model_Layout::getBlock
  */
 public function testGenerateXmlAndBlocks()
 {
     $this->_model->generateXml();
     /* Generate fixture
        file_put_contents(__DIR__ . '/_files/_layout_update.xml', $this->_model->getNode()->asNiceXml());
        */
     $this->assertXmlStringEqualsXmlFile(__DIR__ . '/_files/_layout_update.xml', $this->_model->getXmlString());
     $this->assertEquals(array(), $this->_model->getAllBlocks());
     $expectedBlocks = array('root', 'head', 'head.calendar', 'notifications', 'notification_baseurl', 'cache_notifications', 'notification_survey', 'notification_security', 'messages', 'index_notifications', 'index_notifications_copy');
     $this->_model->generateBlocks();
     $actualBlocks = $this->_model->getAllBlocks();
     $this->assertEquals($expectedBlocks, array_keys($actualBlocks));
     /** @var $block Mage_Adminhtml_Block_Page_Head */
     $block = $this->_model->getBlock('head');
     $this->assertEquals('Magento Admin', $block->getTitle());
     $block = $this->_model->getBlock('head.calendar');
     $this->assertSame($this->_model->getBlock('head'), $block->getParentBlock());
     /** @var $block Mage_Core_Block_Template */
     $block = $this->_model->getBlock('root');
     $this->assertEquals('popup.phtml', $block->getTemplate());
 }
开发者ID:relue,项目名称:magento2,代码行数:26,代码来源:LayoutTest.php

示例4: generateBlocks

 public function generateBlocks($parent = null)
 {
     if (empty($parent)) {
         $parent = $this->getNode();
     }
     if (isset($parent['ifconfig']) && ($configPath = (string) $parent['ifconfig'])) {
         /*echo $configPath . " " . Mage::getStoreConfigFlag($configPath);
           echo "<br />";*/
         if (!Mage::getStoreConfigFlag($configPath)) {
             return;
         }
     }
     if (isset($parent['unlessconfig']) && ($configPath = (string) $parent['unlessconfig'])) {
         if (Mage::getStoreConfigFlag($configPath)) {
             return;
         }
     }
     parent::generateBlocks($parent);
 }
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:19,代码来源:Layout.php

示例5: _renderBlock

 protected function _renderBlock()
 {
     $layout = new Mage_Core_Model_Layout($this->_definition['layout']);
     $layout->generateBlocks();
     $block = $layout->getBlock($this->_definition['block_name']);
     if ($block) {
         $block->setProductIds($this->_getProductIds());
         $collection = $block->getItemsCollection();
         // set correct order
         if (is_object($collection)) {
             foreach ($this->_getProductIds() as $productId) {
                 $item = $collection->getItemById($productId);
                 $collection->removeItemByKey($productId);
                 if ($item) {
                     $collection->addItem($item);
                 }
             }
         }
         $html = $block->toHtml();
     } else {
         $html = self::EMPTY_VALUE;
     }
     return $html;
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:24,代码来源:Productviewed.php

示例6: _createBlock

 /**
  * Creates block encoded in the marker for further processing.
  *
  * @return Mage_Core_Block_Abstract|null
  */
 protected function _createBlock()
 {
     $args = $this->_blockArgs;
     $layout = new Mage_Core_Model_Layout($args['layout']);
     $layout->generateBlocks();
     return $this->_block = $layout->getBlock($args['name']);
 }
开发者ID:AvalonKnight,项目名称:brim_pagecache-2.1.3,代码行数:12,代码来源:Abstract.php

示例7: _prepareLayout

 /**
  * @param Mage_Core_Model_Layout $layout
  * @param array $dynamicBlocks
  * @return Mage_Core_Model_Layout
  */
 protected function _prepareLayout(Mage_Core_Model_Layout $layout, array $dynamicBlocks)
 {
     $xml = simplexml_load_string($layout->getXmlString(), Lesti_Fpc_Helper_Data::LAYOUT_ELEMENT_CLASS);
     $cleanXml = simplexml_load_string('<layout/>', Lesti_Fpc_Helper_Data::LAYOUT_ELEMENT_CLASS);
     $types = array('block', 'reference', 'action');
     foreach ($dynamicBlocks as $blockName) {
         foreach ($types as $type) {
             $xPath = $xml->xpath("//" . $type . "[@name='" . $blockName . "']");
             foreach ($xPath as $child) {
                 $cleanXml->appendChild($child);
             }
         }
     }
     $layout->setXml($cleanXml);
     $layout->generateBlocks();
     return Mage::helper('fpc/block_messages')->initLayoutMessages($layout);
 }
开发者ID:AndreKlang,项目名称:Lesti_Fpc,代码行数:22,代码来源:Observer.php

示例8: generateBlocks

 /**
  * Generates block from layout instructions
  *
  * @param Mage_Core_Model_Layout_Element|null $parent
  * @return void
  */
 public function generateBlocks($parent = null)
 {
     if ($parent !== null) {
         parent::generateBlocks($parent);
         return;
     }
     $this->getProcessor()->execute(ItemInterface::TYPE_LOAD);
     $this->getProcessor()->reset();
 }
开发者ID:albertobraschi,项目名称:EcomDev_LayoutCompiler,代码行数:15,代码来源:Layout.php

示例9: generateBlocks

 /**
  * Create layout blocks hierarchy from layout xml configuration
  *
  * @param Mage_Core_Layout_Element|null $parent
  * @param boolean $parentIsMain  Render $parent first
  */
 public function generateBlocks($parent = null, $parentIsMain = false)
 {
     // Generate parent for single block definitions
     if ($parentIsMain !== false && $parent && $parent->getName() === 'block') {
         $this->_generateBlock($parent, new Varien_Object());
     }
     return parent::generateBlocks($parent);
 }
开发者ID:finelinePG,项目名称:finelink-dev,代码行数:14,代码来源:Layout.php


注:本文中的Mage_Core_Model_Layout::generateBlocks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。