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


PHP Mage_Core_Block_Template::_beforeToHtml方法代码示例

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


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

示例1: _beforeToHtml

 protected function _beforeToHtml()
 {
     if (!$this->getTemplate()) {
         $this->setTemplate('aw_dev/auth/customerlist.phtml');
     }
     return parent::_beforeToHtml();
 }
开发者ID:igorvasiliev4,项目名称:magento_code,代码行数:7,代码来源:Customerlist.php

示例2: _beforeToHtml

 protected function _beforeToHtml()
 {
     if (!Mage::getStoreConfig('uioptimization/w3ccssvalidator/enabled') || !Mage::helper('core')->isDevAllowed() || strpos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') !== false) {
         return '';
     }
     /**
      * To force to include the PEAR libs installed in Magento (downloader/pearlib) - Without that 
      * we cannot have the Services_W3C_HTMLValidator dependencies
      * The var $pear is not used here for the moment. But the call to Varien_Pear is necessary
      */
     //$pear = Varien_Pear::getInstance (); // not compatible with Magento > 1.5
     $config = Mage::getStoreConfig('uioptimization');
     $this->_validator = new Diglin_Services_W3C_CSSValidator();
     if (!empty($config['w3ccssvalidator']['validator_uri'])) {
         $this->_validator->validator_uri = $config['w3ccssvalidator']['validator_uri'];
     }
     if (!empty($config['w3ccssvalidator']['charset'])) {
         $this->_validator->charset = $config['w3ccssvalidator']['charset'];
     }
     if (!empty($config['w3ccssvalidator']['fbd'])) {
         $this->_validator->fbc = (int) $config['w3ccssvalidator']['fbc'];
     }
     if (!empty($config['w3ccssvalidator']['doctype'])) {
         $this->_validator->doctype = $config['w3ccssvalidator']['doctype'];
     }
     if (!empty($config['w3ccssvalidator']['fbc'])) {
         $this->_validator->fbd = (int) $config['w3ccssvalidator']['fbc'];
     }
     //$this->results = $this->_validator->validate('http://www.google.com/');
     $this->results = $this->_validator->validateUri(Mage::helper('core/url')->getCurrentUrl());
     return parent::_beforeToHtml();
 }
开发者ID:FranchuCorraliza,项目名称:magento,代码行数:32,代码来源:W3Ccssvalidator.php

示例3: _beforeToHtml

 protected function _beforeToHtml()
 {
     $testimonials = Mage::getModel('tm_testimonials/data')->getCollection()->addFieldToFilter('status', TM_Testimonials_Model_Data::STATUS_ENABLED)->addStoreFilter(Mage::app()->getStore())->addFieldToFilter('widget', 1);
     $testimonials->getSelect()->order(new Zend_Db_Expr('RAND()'))->limit($this->getItemsNumber());
     $this->setTestimonials($testimonials);
     return parent::_beforeToHtml();
 }
开发者ID:masterdef,项目名称:testimonials,代码行数:7,代码来源:List.php

示例4: _beforeToHtml

 /**
  * Setup the comments block
  *
  */
 protected function _beforeToHtml()
 {
     if (($commentsBlock = $this->getChild('comments')) !== false) {
         $commentsBlock->setPost($this->getPage());
     }
     return parent::_beforeToHtml();
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:11,代码来源:View.php

示例5: _beforeToHtml

 /**
  * Load all enabled widgets
  *
  * @return Fishpig_Wordpress_Block_Sidebar
  */
 protected function _beforeToHtml()
 {
     if (isset(self::$_lockedWidgetAreas[$this->getWidgetArea()])) {
         return $this;
     }
     self::$_lockedWidgetAreas[$this->getWidgetArea()] = true;
     if ($widgets = $this->getWidgetsArray()) {
         $this->_initAvailableWidgets();
         foreach ($widgets as $widgetType) {
             $name = $this->_getWidgetName($widgetType);
             $widgetIndex = $this->_getWidgetIndex($widgetType);
             if ($widget = $this->getWidgetType($name)) {
                 if ($block = $this->getLayout()->createBlock($widget['block'])) {
                     if (isset($widget['template']) && !empty($widget['template'])) {
                         $block->setTemplate($widget['template']);
                     }
                     $block->setWidgetType($name);
                     $block->setWidgetIndex($widgetIndex);
                     $this->setChild('wordpress_widget_' . $widgetType, $block);
                 }
             }
         }
     }
     if (!$this->getTemplate()) {
         $this->setTemplate('wordpress/sidebar.phtml');
     }
     return parent::_beforeToHtml();
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:33,代码来源:Sidebar.php

示例6: _beforeToHtml

 protected function _beforeToHtml()
 {
     $result = parent::_beforeToHtml();
     $quote = Mage::getSingleton('checkout/session')->getQuote();
     // check payment method availability
     $methodInstance = Mage::helper('payment')->getMethodInstance($this->_paymentMethodCode);
     if (!$methodInstance || !$methodInstance->isAvailable($quote)) {
         $this->_shouldRender = false;
         return $result;
     }
     // check payment method type availability
     $configMethod = $methodInstance->getConfigForQuote($quote);
     $methodTypes = $configMethod->getTypes();
     if (!in_array($this->_paymentMethodType, $methodTypes)) {
         $this->_shouldRender = false;
         return $result;
     }
     // check visibility button on shopping cart
     $shortcutOnShoppingCart = $this->getHelperConfig()->getConfigGeneral($quote->getStoreId())->getPaymentPaypalExpressCheckout()->getPaypalExpressCheckoutVisibleOnCart();
     if (empty($shortcutOnShoppingCart)) {
         $this->_shouldRender = false;
         return $result;
     }
     // check if we are in a secure environment
     $isSecure = Mage::app()->getStore()->isCurrentlySecure();
     // set misc data
     $this->setShortcutHtmlId($this->helper('core')->uniqHash('ppe_shortcut_'))->setCheckoutUrl($this->getUrl($this->_startAction, array('_secure' => $isSecure)));
     $this->setImageUrl(Mage::getModel('payone_core/service_paypal_express_checkout', array('quote' => $quote, 'config' => $configMethod))->getCheckoutShortcutImageUrl());
     return $result;
 }
开发者ID:kirchbergerknorr,项目名称:payone-magento,代码行数:30,代码来源:Shortcut.php

示例7: _beforeToHtml

 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     $banner = $this->getBannerObj();
     if ($banner->getData('type_id') == Magestore_AffiliateplusBanner_Helper_Data::BANNER_TYPE_ROTATOR) {
         $randBanner = Mage::getSingleton('affiliateplusbanner/rotator')->getRandomBanner($banner->getData('banner_id'), $banner->getStoreId());
         if ($banner->getData('width')) {
             $randBanner->setData('width', $banner->getData('width'));
         }
         if ($banner->getData('height')) {
             $randBanner->setData('height', $banner->getData('height'));
         }
         $randBanner->setData('banner_id', $banner->getData('banner_id'))->setData('status', $banner->getData('status'))->setData('link', $banner->getData('link'))->setData('program_id', $banner->getData('program_id'))->setData('target', $banner->getData('target'))->setData('rel_nofollow', $banner->getData('rel_nofollow'));
         $this->setBannerObj($randBanner);
     }
     switch ($this->getBannerObj()->getData('type_id')) {
         case Magestore_AffiliateplusBanner_Helper_Data::BANNER_TYPE_FLASH:
             $this->setTemplate('affiliateplusbanner/flash.phtml');
             break;
         case Magestore_AffiliateplusBanner_Helper_Data::BANNER_TYPE_IMAGE:
         case Magestore_AffiliateplusBanner_Helper_Data::BANNER_TYPE_HOVER:
             $this->setTemplate('affiliateplusbanner/image.phtml');
             break;
         case Magestore_AffiliateplusBanner_Helper_Data::BANNER_TYPE_PEEL:
             $this->setTemplate('affiliateplusbanner/peel.phtml');
             break;
         default:
             $this->setTemplate('affiliateplusbanner/blank.phtml');
     }
     if (!$this->getBannerObj()->getData('source_file')) {
         $this->setTemplate('affiliateplusbanner/blank.phtml');
     }
     return $this;
 }
开发者ID:bigtailbear14,项目名称:rosstheme,代码行数:34,代码来源:Magestore_AffiliateplusBanner_Block_Adminhtml_Banner_View.php

示例8: _beforeToHtml

 /**
  * Initialize data and prepare it for output
  */
 protected function _beforeToHtml()
 {
     $this->_prepareLastOrder();
     $this->_prepareLastBillingAgreement();
     $this->_prepareLastRecurringProfiles();
     return parent::_beforeToHtml();
 }
开发者ID:natxetee,项目名称:magento2,代码行数:10,代码来源:Success.php

示例9: _beforeToHtml

 protected function _beforeToHtml()
 {
     if (!$this->getProductId()) {
         return false;
     }
     return parent::_beforeToHtml();
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:7,代码来源:List.php

示例10: _beforeToHtml

 /**
  * Setup the comments block
  *
  */
 protected function _beforeToHtml()
 {
     if ($commentsBlock = $this->getCommentsBlock()) {
         $commentsBlock->setPost($this->getPost());
     }
     return parent::_beforeToHtml();
 }
开发者ID:jokusafet,项目名称:MagentoSource,代码行数:11,代码来源:View.php

示例11: _beforeToHtml

 protected function _beforeToHtml()
 {
     $toolbar = $this->getToolbarBlock();
     // called prepare sortable parameters
     $collection = $this->getLoadedProductCollection();
     // use sortable parameters
     if ($orders = $this->getAvailableOrders()) {
         $toolbar->setAvailableOrders($orders);
     }
     if ($sort = $this->getSortBy()) {
         $toolbar->setDefaultOrder($sort);
     }
     if ($dir = $this->getDefaultDirection()) {
         $toolbar->setDefaultDirection($dir);
     }
     if ($modes = $this->getModes()) {
         $toolbar->setModes($modes);
     }
     // set collection to toolbar and apply sort
     $toolbar->setCollection($collection);
     $this->setChild('toolbar', $toolbar);
     Mage::dispatchEvent('catalog_block_product_list_collection', array('collection' => $this->getLoadedProductCollection()));
     $this->getLoadedProductCollection()->load();
     return parent::_beforeToHtml();
 }
开发者ID:santhosh400,项目名称:ecart,代码行数:25,代码来源:Trending.php

示例12: _beforeToHtml

 protected function _beforeToHtml()
 {
     $testimonials = $this->_getTestimonialsCollection();
     $this->setTestimonials($testimonials);
     $this->_placeholderImage = Mage::helper('testimonials')->getPlaceholderImage();
     return parent::_beforeToHtml();
 }
开发者ID:masterdef,项目名称:testimonials,代码行数:7,代码来源:Content.php

示例13: _beforeToHtml

 protected function _beforeToHtml()
 {
     $this->_language = Mage::getStoreConfig("sag_settings/{$this->_configNode}/language");
     $this->_size = Mage::getStoreConfig("sag_settings/{$this->_configNode}/size");
     $this->_color = Mage::getStoreConfig("sag_settings/{$this->_configNode}/color");
     return parent::_beforeToHtml();
 }
开发者ID:bigtailbear14,项目名称:rosstheme,代码行数:7,代码来源:Button.php

示例14: _beforeToHtml

 protected function _beforeToHtml()
 {
     if (!Mage::helper('magenotification')->checkLicenseKey('Sociallogin')) {
         $this->setTemplate(null);
     }
     return parent::_beforeToHtml();
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:7,代码来源:Livelogin.php

示例15: _beforeToHtml

 /**
  * If post view, setup the post with child blocks
  *
  * @return $this
  */
 protected function _beforeToHtml()
 {
     if ($this->getPost() && $this->_getBlockForPostPrepare() !== false) {
         $this->preparePost($this->getPost());
     }
     return parent::_beforeToHtml();
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:12,代码来源:Abstract.php


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