Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Edit.php
Go to the documentation of this file.
1 <?php
7 
14 class Edit extends \Magento\Backend\Block\Widget\Form\Container
15 {
21  protected $coreRegistry;
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 = 'id';
43  $this->_blockGroup = 'Magento_Search';
44  $this->_controller = 'adminhtml_term';
45 
46  parent::_construct();
47 
48  $this->buttonList->update('save', 'label', __('Save Search'));
49  $this->buttonList->update('delete', 'label', __('Delete Search'));
50  }
51 
55  public function getHeaderText()
56  {
57  if ($this->coreRegistry->registry('current_catalog_search')->getId()) {
58  $queryText = $this->escapeHtml($this->coreRegistry->registry('current_catalog_search')->getQueryText());
59  return __("Edit Search '%1'", $queryText);
60  } else {
61  return __('New Search');
62  }
63  }
64 }
__()
Definition: __.php:13
__construct(\Magento\Backend\Block\Widget\Context $context, \Magento\Framework\Registry $registry, array $data=[])
Definition: Edit.php:28