本文整理汇总了PHP中Mage_Core_Block_Template类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Block_Template类的具体用法?PHP Mage_Core_Block_Template怎么用?PHP Mage_Core_Block_Template使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_Core_Block_Template类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
}
示例2: manejandobloquesAction
public function manejandobloquesAction()
{
$block_1 = new Mage_Core_Block_Text();
$block_1->setText('Original Text');
$block_2 = new Mage_Core_Block_Text();
$block_2->setText('The second sentence.');
$main_block = new Mage_Core_Block_Template();
$main_block->setTemplate('nofrills/manejandobloques.phtml');
$main_block->setChild('the_first', $block_1);
$main_block->setChild('the_second', $block_2);
$block_1->setText('Wait , I want this text instead .');
echo $main_block->toHtml();
}
示例3: __construct
public function __construct()
{
parent::__construct();
$this->setTemplate('sales/order/details.phtml');
$this->setOrder(Mage::getModel('sales/order')->load($this->getRequest()->getParam('order_id')));
Mage::registry('action')->getLayout()->getBlock('root')->setHeaderTitle(Mage::helper('sales')->__('Order Details'));
}
示例4: _toHtml
protected function _toHtml()
{
if (!(bool) Mage::getStoreConfig('specialproducts/general/active')) {
return '';
}
return parent::_toHtml();
}
示例5: _toHtml
protected function _toHtml()
{
if ($this->_collection->getSize() > 0) {
return parent::_toHtml();
}
return '';
}
示例6: _toHtml
protected function _toHtml()
{
if (is_link(dirname(Mage::getModuleDir('', 'PostcodeNl_Api'))) && !Mage::getStoreConfig('dev/template/allow_symlink')) {
throw new Mage_Core_Exception('Postcode.nl API Development: Symlinks not enabled! (set at Admin->System->Configuration->Advanced->Developer->Template Settings)');
}
return parent::_toHtml();
}
示例7: __construct
public function __construct()
{
parent::__construct();
$this->setTemplate('review/customer/list.phtml');
$this->_collection = Mage::getModel('review/review')->getProductCollection();
$this->_collection->addStoreFilter(Mage::app()->getStore()->getId())->addCustomerFilter(Mage::getSingleton('customer/session')->getCustomerId())->setDateOrder()->setPageSize(5)->load()->addReviewSummary();
}
示例8: _toHtml
/**
* Render block HTML
*
* @return string
*/
protected function _toHtml()
{
if (!$this->getCanUseToken()) {
return '';
}
return parent::_toHtml();
}
示例9: _toHtml
protected function _toHtml()
{
if (Mage::helper('sales/reorder')->isAllow() && Mage::getSingleton('customer/session')->isLoggedIn()) {
return parent::_toHtml();
}
return '';
}
示例10: _toHtml
public function _toHtml()
{
if (!Mage::getSingleton('helpdesk/config')->getSatisfactionIsActive()) {
return '';
}
return parent::_toHtml();
}
示例11: _construct
protected function _construct()
{
$this->setTemplate('arioem/part/selector.phtml');
// here we need to let Magento independent ARI API gateway know what's the current customer cost
Mage::getSingleton('customer/session')->unsCustomerCostPercent()->setCustomerCostPercent(Mage::helper('arioem')->getCustomerCostPercent());
return parent::_construct();
}
示例12: _prepareLayout
protected function _prepareLayout()
{
parent::_prepareLayout();
$this->getLayout()->createBlock('catalog/breadcrumbs');
if ($headBlock = $this->getLayout()->getBlock('head')) {
$category = $this->getCurrentCategory();
if ($title = $category->getMetaTitle()) {
$headBlock->setTitle($title);
}
if ($description = $category->getMetaDescription()) {
$headBlock->setDescription($description);
}
if ($keywords = $category->getMetaKeywords()) {
$headBlock->setKeywords($keywords);
}
if ($this->helper('catalog/category')->canUseCanonicalTag()) {
$headBlock->addLinkRel('canonical', $category->getUrl());
}
/*
want to show rss feed in the url
*/
if ($this->IsRssCatalogEnable() && $this->IsTopCategory()) {
$title = $this->helper('rss')->__('%s RSS Feed', $this->getCurrentCategory()->getName());
$headBlock->addItem('rss', $this->getRssLink(), 'title="' . $title . '"');
}
}
return $this;
}
示例13: _toHtml
public function _toHtml()
{
if (!Mage::helper('checkout')->isMultishippingCheckoutAvailable()) {
return '';
}
return parent::_toHtml();
}
示例14: _toHtml
/**
* Render GA tracking scripts
*
* @return string
*/
protected function _toHtml()
{
if (!Mage::helper('enterprise_googleanalyticsuniversal')->isTagManagerAvailable()) {
return '';
}
return parent::_toHtml();
}
示例15: _toHtml
/**
* {@inheritdoc}
*/
protected function _toHtml()
{
$this->setChild('xml', $this->getLayout()->createBlock('realtimedespatch/adminhtml_exports_view_accordion'));
$this->getChild('xml')->setExport($this->getExport());
$this->getChild('lines')->setExport($this->getExport())->setReferenceLabel($this->getReferenceLabel());
return parent::_toHtml();
}