Example #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();
 }
Example #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();
 }
Example #3
0
 /**
  * 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();
 }