Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
All Data Structures Namespaces Files Functions Variables Pages
Edit.php
Go to the documentation of this file.
1 <?php
7 
8 class Edit extends \Magento\Backend\Block\Widget\Form\Container
9 {
15  protected $_coreRegistry = null;
16 
23  public function __construct(
24  \Magento\Backend\Block\Widget\Context $context,
25  \Magento\Framework\Registry $registry,
26  array $data = []
27  ) {
28  $this->_coreRegistry = $registry;
29  parent::__construct($context, $data);
30  }
31 
37  protected function _construct()
38  {
39  $this->_objectId = 'id';
40  $this->_controller = 'adminhtml_agreement';
41  $this->_blockGroup = 'Magento_CheckoutAgreements';
42 
43  parent::_construct();
44 
45  $this->buttonList->update('save', 'label', __('Save Condition'));
46  $this->buttonList->update('delete', 'label', __('Delete Condition'));
47  }
48 
54  public function getHeaderText()
55  {
56  if ($this->_coreRegistry->registry('checkout_agreement')->getId()) {
57  return __('Edit Terms and Conditions');
58  } else {
59  return __('New Terms and Conditions');
60  }
61  }
62 }
__()
Definition: __.php:13
__construct(\Magento\Backend\Block\Widget\Context $context, \Magento\Framework\Registry $registry, array $data=[])
Definition: Edit.php:23