本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例7: _beforeToHtml
/**
* @return $this
*/
public function _beforeToHtml()
{
return parent::_beforeToHtml();
}
示例8: _beforeToHtml
/**
* Prepares block to render
*
* @return $this
*/
protected function _beforeToHtml()
{
return parent::_beforeToHtml();
}