Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Address.php
Go to the documentation of this file.
1 <?php
7 
14 class Address 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 
42  protected function _construct()
43  {
44  $this->_controller = 'adminhtml_order';
45  $this->_mode = 'address';
46  $this->_blockGroup = 'Magento_Sales';
47  parent::_construct();
48  $this->buttonList->update('save', 'label', __('Save Order Address'));
49  $this->buttonList->remove('delete');
50  }
51 
57  public function getHeaderText()
58  {
59  $address = $this->_coreRegistry->registry('order_address');
60  $orderId = $address->getOrder()->getIncrementId();
61  if ($address->getAddressType() == 'shipping') {
62  $type = __('Shipping');
63  } else {
64  $type = __('Billing');
65  }
66  return __('Edit Order %1 %2 Address', $orderId, $type);
67  }
68 
74  public function getBackUrl()
75  {
76  $address = $this->_coreRegistry->registry('order_address');
77  return $this->getUrl('sales/*/view', ['order_id' => $address ? $address->getOrder()->getId() : null]);
78  }
79 }
__()
Definition: __.php:13
$address
Definition: customer.php:38
$type
Definition: item.phtml:13
__construct(\Magento\Backend\Block\Widget\Context $context, \Magento\Framework\Registry $registry, array $data=[])
Definition: Address.php:28