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


PHP Mage_Core_Block_Abstract::setLayout方法代码示例

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


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

示例1: _getPlaceHolderBlock

 /**
  * Get Placeholder Block
  *
  * @return Mage_Core_Block_Abstract
  */
 protected function _getPlaceHolderBlock()
 {
     if (null === $this->_placeholderBlock) {
         $blockName = $this->_placeholder->getAttribute('block');
         $this->_placeholderBlock = new $blockName();
         $this->_placeholderBlock->setTemplate($this->_placeholder->getAttribute('template'));
         $this->_placeholderBlock->setLayout(Mage::app()->getLayout());
         $this->_placeholderBlock->setSkipRenderTag(true);
     }
     return $this->_placeholderBlock;
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:16,代码来源:Abstract.php

示例2: testHelper

 public function testHelper()
 {
     // Without layout
     $this->assertInstanceOf('Mage_Core_Helper_Data', $this->_block->helper('Mage_Core_Helper_Data'));
     // With layout
     $this->_block->setLayout(new Mage_Core_Model_Layout());
     $helper = $this->_block->helper('Mage_Core_Helper_Data');
     try {
         $this->assertInstanceOf('Mage_Core_Helper_Data', $helper);
         $this->assertInstanceOf('Mage_Core_Model_Layout', $helper->getLayout());
         /* Helper is a 'singleton', so assigned layout may affect further helper usage */
         $helper->setLayout(null);
     } catch (Exception $e) {
         $helper->setLayout(null);
         throw $e;
     }
 }
开发者ID:nemphys,项目名称:magento2,代码行数:17,代码来源:AbstractTest.php

示例3: _createSampleBlocks

 /**
  * Create <N> sample blocks
  *
  * @param int $qty
  * @param bool $withLayout
  * @param string $className
  * @return array
  */
 protected function _createSampleBlocks($qty, $withLayout = true, $className = 'Mage_Core_Block_Template')
 {
     $blocks = array();
     $names = array();
     $layout = false;
     if ($withLayout) {
         $layout = new Mage_Core_Model_Layout();
         $this->_block->setLayout($layout);
     }
     for ($i = 0; $i < $qty; $i++) {
         $block = new $className();
         $name = uniqid('block.');
         $block->setNameInLayout($name);
         $blocks[] = $block;
         $names[] = $name;
         if ($layout) {
             $block->setLayout($layout);
             $layout->setBlock($name, $block);
         }
     }
     return array($blocks, $names);
 }
开发者ID:relue,项目名称:magento2,代码行数:30,代码来源:AbstractTest.php


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