本文整理汇总了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;
}
示例2: getTemplate
public function getTemplate()
{
if (!Mage::helper('magenotification')->checkLicenseKey('Customerreward')) {
return null;
} else {
return parent::getTemplate();
}
}
示例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
}
示例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;
}
示例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;
}
示例6: testSetGetTemplate
public function testSetGetTemplate()
{
$this->assertEmpty($this->_block->getTemplate());
$this->_block->setTemplate('value');
$this->assertEquals('value', $this->_block->getTemplate());
}