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


PHP Mage_Core_Block_Abstract::_transportObject方法代码示例

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


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

示例1: toHtml

 /**
  * Produce and return block's html output
  *
  * It is a final method, but you can override _toHtml() method in descendants if needed.
  *
  * @return string
  */
 public final function toHtml()
 {
     Mage::dispatchEvent('core_block_abstract_to_html_before', array('block' => $this));
     if (Mage::getStoreConfig('advanced/modules_disable_output/' . $this->getModuleName())) {
         return '';
     }
     /* START: Added by Cm_Diehard */
     // if setBlockIsDynamic and setSuppressOutput then we automatically render only a placeholder tag.
     if ($this->getBlockIsDynamic() && Mage::registry('diehard_lifetime')) {
         if ($this->getSuppressOutput()) {
             return '<div id="' . substr($this->getDiehardSelector(), 1) . '"></div>';
         } else {
             if (FALSE) {
                 return '<!-- DIEHARD_BLOCK|' . $this->getDiehardSelector() . '|' . json_encode($this->getCacheKeyInfo()) . ' -->';
             }
         }
     }
     /* END: Added by Cm_Diehard */
     $html = $this->_loadCache();
     if ($html === false) {
         $translate = Mage::getSingleton('core/translate');
         /** @var $translate Mage_Core_Model_Translate */
         if ($this->hasData('translate_inline')) {
             $translate->setTranslateInline($this->getData('translate_inline'));
         }
         $this->_beforeToHtml();
         $html = $this->_toHtml();
         $this->_saveCache($html);
         if ($this->hasData('translate_inline')) {
             $translate->setTranslateInline(true);
         }
     }
     $html = $this->_afterToHtml($html);
     /**
      * Check framing options
      */
     if ($this->_frameOpenTag) {
         $html = '<' . $this->_frameOpenTag . '>' . $html . '<' . $this->_frameCloseTag . '>';
     }
     /**
      * Use single transport object instance for all blocks
      */
     if (self::$_transportObject === null) {
         self::$_transportObject = new Varien_Object();
     }
     self::$_transportObject->setHtml($html);
     Mage::dispatchEvent('core_block_abstract_to_html_after', array('block' => $this, 'transport' => self::$_transportObject));
     $html = self::$_transportObject->getHtml();
     return $html;
 }
开发者ID:brentwpeterson,项目名称:Cm_Diehard,代码行数:57,代码来源:Abstract.php

示例2: toHtml

 /**
  * Produce and return block's html output
  *
  * It is a final method, but you can override _toHtml() method in descendants if needed.
  *
  * @return string
  */
 public final function toHtml()
 {
     Mage::dispatchEvent('core_block_abstract_to_html_before', array('block' => $this));
     if (Mage::getStoreConfig('advanced/modules_disable_output/' . $this->getModuleName())) {
         return '';
     }
     $html = $this->_loadCache();
     if ($html === false) {
         $translate = Mage::getSingleton('core/translate');
         /** @var $translate Mage_Core_Model_Translate */
         if ($this->hasData('translate_inline')) {
             $translate->setTranslateInline($this->getData('translate_inline'));
         }
         $this->_beforeToHtml();
         $html = $this->_toHtml();
         $this->_saveCache($html);
         if ($this->hasData('translate_inline')) {
             $translate->setTranslateInline(true);
         }
     }
     $html = $this->_afterToHtml($html);
     /**
      * Check framing options
      */
     if ($this->_frameOpenTag) {
         $html = '<' . $this->_frameOpenTag . '>' . $html . '<' . $this->_frameCloseTag . '>';
     }
     /**
      * Use single transport object instance for all blocks
      */
     if (self::$_transportObject === null) {
         self::$_transportObject = new Varien_Object();
     }
     self::$_transportObject->setHtml($html);
     Mage::dispatchEvent('core_block_abstract_to_html_after', array('block' => $this, 'transport' => self::$_transportObject));
     $html = self::$_transportObject->getHtml();
     return $html;
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:45,代码来源:Abstract.php

示例3: toHtml

 /**
  * Produce and return block's html output
  *
  * It is a final method, but you can override _toHtml() method in descendants if needed.
  *
  * @return string
  */
 public final function toHtml()
 {
     // MSP HACK: Start
     /* @var $ltsCache MSP_LTS2_Model_Cache */
     $ltsCache = Mage::getSingleton('msp_lts2/cache');
     if ($ltsCache->isActive() && !Mage::helper('msp_lts2')->isAdminArea() && $ltsCache->canCacheAction()) {
         $blockName = $this->getNameInLayout();
         $blockCacheHandling = $ltsCache->getBlockCacheHandling($blockName);
         if (in_array($blockCacheHandling, array(MSP_LTS2_Model_Rule_Cache::HANDLING_CACHE))) {
             $cacheKey = $ltsCache->getBlockCacheKey($blockName);
             if ($ltsCache->cacheItemExists($cacheKey)) {
                 $ltsCache->setCacheBlockStatus($blockName, MSP_LTS2_Model_Cache::CACHE_STATUS_HIT);
                 return $ltsCache->getBlockPlaceholder($blockName, true);
             }
         }
     }
     // MSP HACK: End
     Mage::dispatchEvent('core_block_abstract_to_html_before', array('block' => $this));
     if (Mage::getStoreConfig('advanced/modules_disable_output/' . $this->getModuleName())) {
         return '';
     }
     $html = $this->_loadCache();
     if ($html === false) {
         $translate = Mage::getSingleton('core/translate');
         /** @var $translate Mage_Core_Model_Translate */
         if ($this->hasData('translate_inline')) {
             $translate->setTranslateInline($this->getData('translate_inline'));
         }
         $this->_beforeToHtml();
         $html = $this->_toHtml();
         $this->_saveCache($html);
         if ($this->hasData('translate_inline')) {
             $translate->setTranslateInline(true);
         }
     }
     $html = $this->_afterToHtml($html);
     /**
      * Check framing options
      */
     if ($this->_frameOpenTag) {
         $html = '<' . $this->_frameOpenTag . '>' . $html . '<' . $this->_frameCloseTag . '>';
     }
     /**
      * Use single transport object instance for all blocks
      */
     if (self::$_transportObject === null) {
         self::$_transportObject = new Varien_Object();
     }
     self::$_transportObject->setHtml($html);
     Mage::dispatchEvent('core_block_abstract_to_html_after', array('block' => $this, 'transport' => self::$_transportObject));
     $html = self::$_transportObject->getHtml();
     // MSP HACK: Start
     if ($ltsCache->isActive() && !Mage::helper('msp_lts2')->isAdminArea() && $ltsCache->canCacheAction()) {
         if (in_array($blockCacheHandling, array(MSP_LTS2_Model_Rule_Cache::HANDLING_CACHE))) {
             $ltsCache->setBlock($blockName, $html);
         } elseif (in_array($blockCacheHandling, array(MSP_LTS2_Model_Rule_Cache::HANDLING_NOCACHE))) {
             $ltsCache->setTmpBlock($blockName, $html);
         }
         if (in_array($blockCacheHandling, array(MSP_LTS2_Model_Rule_Cache::HANDLING_CACHE, MSP_LTS2_Model_Rule_Cache::HANDLING_NOCACHE))) {
             return $ltsCache->getBlockPlaceholder($blockName);
         }
     }
     // MSP HACK: End
     return $html;
 }
开发者ID:eperrotta,项目名称:lts2,代码行数:72,代码来源:Abstract.php


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