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


PHP Mage_Core_Block_Template::getTemplate方法代码示例

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


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

示例1: getTemplate

 public function getTemplate()
 {
     $template = parent::getTemplate();
     if (!$template) {
         $template = 'tm/testimonials/widget/list.phtml';
     }
     return $template;
 }
开发者ID:masterdef,项目名称:testimonials,代码行数:8,代码来源:List.php

示例2: getTemplate

 public function getTemplate()
 {
     if (!Mage::helper('magenotification')->checkLicenseKey('Customerreward')) {
         return null;
     } else {
         return parent::getTemplate();
     }
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:8,代码来源:Offer.php

示例3: testSetMethodFormTemplate

 public function testSetMethodFormTemplate()
 {
     $childBlockA = new Mage_Core_Block_Template();
     $childBlockB = new Mage_Core_Block_Template();
     $func = function ($blockName) use($childBlockA, $childBlockB) {
         switch ($blockName) {
             case 'payment.method.a':
                 return $childBlockA;
             case 'payment.method.b':
                 return $childBlockB;
         }
         return null;
     };
     $block = $this->getMock('Mage_Payment_Block_Form_Container', array('getChildBlock'));
     $block->expects($this->atLeastOnce())->method('getChildBlock')->will($this->returnCallback($func));
     $template = 'any_template.phtml';
     $this->assertNotEquals($template, $childBlockA->getTemplate());
     $this->assertNotEquals($template, $childBlockB->getTemplate());
     $block->setMethodFormTemplate('a', $template);
     $this->assertEquals($template, $childBlockA->getTemplate());
     // Template is set to the block
     $this->assertNotEquals($template, $childBlockB->getTemplate());
     // Template is not propagated to other blocks
 }
开发者ID:nemphys,项目名称:magento2,代码行数:24,代码来源:ContainerTest.php

示例4: getTemplate

 /**
  * Get relevant path to template
  *
  * @return string
  */
 public function getTemplate()
 {
     if (!Mage::getStoreConfig('easycatalogimg/general/enabled')) {
         return '';
     }
     $category = $this->getCurrentCategory();
     if ($category && $category->getLevel() > 1) {
         $isAnchor = $category->getIsAnchor();
         $enabledForAnchor = Mage::getStoreConfigFlag('easycatalogimg/category/enabled_for_anchor');
         $enabledForDefault = Mage::getStoreConfigFlag('easycatalogimg/category/enabled_for_default');
         if ($isAnchor && !$enabledForAnchor || !$isAnchor && !$enabledForDefault) {
             return '';
         }
     }
     $template = parent::getTemplate();
     if (!$template) {
         $template = $this->_getData('template');
     }
     return $template;
 }
开发者ID:xiaoguizhidao,项目名称:BumblebeeSite,代码行数:25,代码来源:List.php

示例5: getTemplate

 /**
  * Get relevant path to template
  *
  * @return string
  */
 public function getTemplate()
 {
     if (!Mage::getStoreConfig('easycatalogimg/general/enabled')) {
         return '';
     }
     /**
      * don't show the block:
      *  if pagination is used
      *  if filter is applied
      */
     $page = (int) $this->getRequest()->getParam('p', 1);
     if ($this->getHideWhenFilterIsUsed() && ($page > 1 || Mage::getSingleton('catalog/layer')->getState()->getFilters())) {
         return '';
     }
     $category = $this->getCurrentCategory();
     if ($category && $category->getLevel() > 1) {
         $isAnchor = $category->getIsAnchor();
         $enabledForAnchor = $this->getEnabledForAnchor();
         $enabledForDefault = $this->getEnabledForDefault();
         if ($isAnchor && !$enabledForAnchor || !$isAnchor && !$enabledForDefault) {
             return '';
         }
     }
     $template = parent::getTemplate();
     if (!$template) {
         $template = $this->_getData('template');
     }
     return $template;
 }
开发者ID:rommmka,项目名称:easycatalogimg,代码行数:34,代码来源:List.php

示例6: testSetGetTemplate

 public function testSetGetTemplate()
 {
     $this->assertEmpty($this->_block->getTemplate());
     $this->_block->setTemplate('value');
     $this->assertEquals('value', $this->_block->getTemplate());
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:6,代码来源:Template.php


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