示例#1
0
 /**
  * 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'));
     }
     parent::_beforeToHtml();
 }
示例#2
0
 /**
  * Retrieve required options from parent
  *
  * @return void
  * @throws \Magento\Framework\Exception\LocalizedException
  */
 protected function _beforeToHtml()
 {
     if (!$this->getParentBlock()) {
         throw new \Magento\Framework\Exception\LocalizedException(__('Invalid parent block for this block'));
     }
     $this->setOrder($this->getParentBlock()->getOrder());
     parent::_beforeToHtml();
 }
示例#3
0
文件: Items.php 项目: aiesh/magento2
 /**
  * Prepare child blocks
  *
  * @return string
  */
 protected function _beforeToHtml()
 {
     $this->addChild('submit_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Submit Shipment'), 'class' => 'save submit-button primary', 'onclick' => 'submitShipment(this);'));
     return parent::_beforeToHtml();
 }