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


PHP Mage_Core_Block_Template::getNameInLayout方法代码示例

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


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

示例1: _createChildBlocksRecursively

 /**
  * @param Mage_Core_Block_Template $parent
  * @param $items
  */
 protected function _createChildBlocksRecursively($parent, $items)
 {
     foreach ($items as $key => $item) {
         $block = $this->getLayout()->createBlock('manapro_filtertree/item', $parent->getNameInLayout() . '_' . $key, array('item' => $item, 'filter' => $this, 'template' => 'manapro/filtertree/item.phtml', 'show_in_filter' => $this->getShowInFilter()));
         $parent->setChild($parent->getNameInLayout() . '_' . $key, $block);
         $this->_createChildBlocksRecursively($block, $item->getItems());
     }
 }
开发者ID:xiaoguizhidao,项目名称:cupboardglasspipes.ecomitize.com,代码行数:12,代码来源:Filter.php

示例2: _getBlockLayoutHandles

 /**
  * Get the active layout handles for this block and any child blocks
  *
  * This is probably kind of slow since it uses a bunch of xpath searches
  * but this was the easiest way to get the info needed. Should be a target
  * for future optimization
  *
  * There is an issue with encoding the used handles in the URL, if the used
  * handles change (ex customer logs in), the cached version of the page will
  * still have the old handles encoded in it's ESI url. This can lead to
  * weirdness like the "Log in" link displaying for already logged in
  * visitors on pages that were initially visited by not-logged-in visitors.
  * Not sure of a solution for this yet.
  *
  * Above problem is currently solved by EsiController::_swapCustomerHandles()
  * but it would be best to find a more general solution to this.
  *
  * @param  Mage_Core_Block_Template $block
  * @return array
  */
 protected function _getBlockLayoutHandles($block)
 {
     Varien_Profiler::start('turpentine::observer::esi::_getBlockLayoutHandles');
     $layout = $block->getLayout();
     $layoutXml = Mage::helper('turpentine/esi')->getLayoutXml();
     $activeHandles = array();
     // get the xml node representing the block we're working on (from the
     // default handle probably)
     $blockNode = current($layout->getNode()->xpath(sprintf('//block[@name=\'%s\']', $block->getNameInLayout())));
     $childBlocks = Mage::helper('turpentine/data')->getChildBlockNames($blockNode);
     foreach ($childBlocks as $blockName) {
         foreach ($layout->getUpdate()->getHandles() as $handle) {
             // check if this handle has any block or reference tags that
             // refer to this block or a child block, unless the handle name
             // is blank
             if ($handle !== '' && $layoutXml->xpath(sprintf('//%s//*[@name=\'%s\']', $handle, $blockName))) {
                 $activeHandles[] = $handle;
             }
         }
     }
     if (!$activeHandles) {
         $activeHandles[] = 'default';
     }
     Varien_Profiler::stop('turpentine::observer::esi::_getBlockLayoutHandles');
     return array_unique($activeHandles);
 }
开发者ID:jronatay,项目名称:ultimo-magento-jron,代码行数:46,代码来源:Esi.php

示例3: isBlockAddToCartBlock

 /**
  * Check to see if the block is an add-to-cart block
  *
  * @param Mage_Core_Block_Template $oBlock
  * @return bool
  */
 public function isBlockAddToCartBlock($oBlock)
 {
     $aAddToCartBlockClassNames = $this->getAddToCartBlockLayoutNames();
     return in_array($oBlock->getNameInLayout(), $aAddToCartBlockClassNames);
 }
开发者ID:dwdonline,项目名称:B2BProfessional,代码行数:11,代码来源:Data.php


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