Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Create.php
Go to the documentation of this file.
1 <?php
7 
14 class Create extends \Magento\Backend\Block\Widget\Form\Container
15 {
21  protected $_coreRegistry = null;
22 
28  public function __construct(
29  \Magento\Backend\Block\Widget\Context $context,
30  \Magento\Framework\Registry $registry,
31  array $data = []
32  ) {
33  $this->_coreRegistry = $registry;
34  parent::__construct($context, $data);
35  }
36 
40  protected function _construct()
41  {
42  $this->_objectId = 'order_id';
43  $this->_mode = 'create';
44 
45  parent::_construct();
46 
47  $this->buttonList->remove('save');
48  $this->buttonList->remove('delete');
49  }
50 
56  public function getShipment()
57  {
58  return $this->_coreRegistry->registry('current_shipment');
59  }
60 
64  public function getHeaderText()
65  {
66  $header = __('New Shipment for Order #%1', $this->getShipment()->getOrder()->getRealOrderId());
67  return $header;
68  }
69 
73  public function getBackUrl()
74  {
75  return $this->getUrl(
76  'sales/order/view',
77  ['order_id' => $this->getShipment() ? $this->getShipment()->getOrderId() : null]
78  );
79  }
80 }
__construct(\Magento\Backend\Block\Widget\Context $context, \Magento\Framework\Registry $registry, array $data=[])
Definition: Create.php:28
__()
Definition: __.php:13