/** * 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(); }
/** * 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(); }
/** * 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(); }