當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Template::_beforeToHtml方法代碼示例

本文整理匯總了PHP中Magento\Backend\Block\Template::_beforeToHtml方法的典型用法代碼示例。如果您正苦於以下問題:PHP Template::_beforeToHtml方法的具體用法?PHP Template::_beforeToHtml怎麽用?PHP Template::_beforeToHtml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Backend\Block\Template的用法示例。


在下文中一共展示了Template::_beforeToHtml方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _beforeToHtml

 /**
  * {@inheritdoc}
  */
 protected function _beforeToHtml()
 {
     $this->assign('form', $this->_form);
     $this->assign('element', $this->_element);
     $this->assign('formBlock', $this->_formBlock);
     return parent::_beforeToHtml();
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:10,代碼來源:Element.php

示例2: _beforeToHtml

 /**
  * Retrieve required options from parent
  *
  * @return void
  * @throws \Magento\Framework\Exception\LocalizedException
  */
 protected function _beforeToHtml()
 {
     if (!$this->getParentBlock()) {
         throw new \Magento\Framework\Exception\LocalizedException(__('Please correct the parent block for this block.'));
     }
     $this->setEntity($this->getParentBlock()->getSource());
     parent::_beforeToHtml();
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:14,代碼來源:View.php

示例3: _beforeToHtml

 /**
  * Retrieve required options from parent
  *
  * @return void
  * @throws \Magento\Framework\Model\Exception
  */
 protected function _beforeToHtml()
 {
     if (!$this->getParentBlock()) {
         throw new \Magento\Framework\Model\Exception(__('Invalid parent block for this block'));
     }
     $this->setPayment($this->getParentBlock()->getOrder()->getPayment());
     parent::_beforeToHtml();
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:14,代碼來源:Payment.php

示例4: _beforeToHtml

 /**
  * Before rendering html, but after trying to load cache
  *
  * @return AbstractBlock
  */
 protected function _beforeToHtml()
 {
     $this->setChild('form', $this->getLayout()->createBlock('Magento\\Newsletter\\Block\\Adminhtml\\Queue\\Edit\\Form', 'form'));
     return parent::_beforeToHtml();
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:10,代碼來源:Edit.php

示例5: _beforeToHtml

 /**
  * {@inheritdoc}
  */
 protected function _beforeToHtml()
 {
     // TODO - Moved to Beta 2, no breadcrumbs displaying in Beta 1
     // $this->assign('links', $this->_links);
     return parent::_beforeToHtml();
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:9,代碼來源:Breadcrumbs.php

示例6: _beforeToHtml

 /**
  * Execute before toHtml() code.
  *
  * @return $this
  */
 public function _beforeToHtml()
 {
     $this->_currency = $this->_currencyFactory->create()->load($this->_scopeConfig->getValue(Currency::XML_PATH_CURRENCY_BASE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE));
     $this->_collection = $this->_collectionFactory->create()->setCustomerIdFilter((int) $this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID))->setOrderStateFilter(Order::STATE_CANCELED, true)->load();
     $this->_groupedCollection = [];
     foreach ($this->_collection as $sale) {
         if ($sale->getStoreId() !== null) {
             $store = $this->_storeManager->getStore($sale->getStoreId());
             $websiteId = $store->getWebsiteId();
             $groupId = $store->getGroupId();
             $storeId = $store->getId();
             $sale->setWebsiteId($store->getWebsiteId());
             $sale->setWebsiteName($store->getWebsite()->getName());
             $sale->setGroupId($store->getGroupId());
             $sale->setGroupName($store->getGroup()->getName());
         } else {
             $websiteId = 0;
             $groupId = 0;
             $storeId = 0;
             $sale->setStoreName(__('Deleted Stores'));
         }
         $this->_groupedCollection[$websiteId][$groupId][$storeId] = $sale;
         $this->_websiteCounts[$websiteId] = isset($this->_websiteCounts[$websiteId]) ? $this->_websiteCounts[$websiteId] + 1 : 1;
     }
     return parent::_beforeToHtml();
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:31,代碼來源:Sales.php

示例7: _beforeToHtml

 /**
  * @return $this
  */
 public function _beforeToHtml()
 {
     return parent::_beforeToHtml();
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:7,代碼來源:Online.php

示例8: _beforeToHtml

 /**
  * Prepares block to render
  *
  * @return $this
  */
 protected function _beforeToHtml()
 {
     return parent::_beforeToHtml();
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:9,代碼來源:Subscriber.php


注:本文中的Magento\Backend\Block\Template::_beforeToHtml方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。