Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Role.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\User\Block;
7 
15 class Role extends \Magento\Backend\Block\Widget\Grid\Container
16 {
20  protected $_controller = 'user_role';
21 
25  protected $_blockGroup = 'Magento_User';
26 
32  protected function _construct()
33  {
34  $this->_headerText = __('Roles');
35  $this->_addButtonLabel = __('Add New Role');
36  parent::_construct();
37  }
38 
42  public function getCreateUrl()
43  {
44  return $this->getUrl('*/*/editrole');
45  }
46 
50  protected function _prepareLayout()
51  {
52  if (!$this->getLayout()->getChildName($this->getNameInLayout(), 'grid')) {
53  $this->setChild(
54  'grid',
55  $this->getLayout()->createBlock(
56  $this->_blockGroup . '\\Block\\Role\\Grid',
57  $this->_controller . '.grid'
58  )->setSaveParametersInSession(
59  true
60  )
61  );
62  }
63  return \Magento\Backend\Block\Widget\Container::_prepareLayout();
64  }
65 
71  protected function _toHtml()
72  {
73  $this->_eventManager->dispatch('permissions_role_html_before', ['block' => $this]);
74  return parent::_toHtml();
75  }
76 }
__()
Definition: __.php:13