Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-user
Block
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
}
Magento\User\Block\Role\$_controller
$_controller
Definition:
Role.php:20
Magento\Framework\View\Element\AbstractBlock\getNameInLayout
getNameInLayout()
Definition:
AbstractBlock.php:1004
Magento\User\Block\Role
Definition:
Role.php:15
Magento\User\Block\Role\_toHtml
_toHtml()
Definition:
Role.php:71
Magento\User\Block\Role\_prepareLayout
_prepareLayout()
Definition:
Role.php:50
__
__()
Definition:
__.php:13
Magento\User\Block
Magento\Framework\View\Element\AbstractBlock\getUrl
getUrl($route='', $params=[])
Definition:
AbstractBlock.php:773
Magento\User\Block\Role\$_blockGroup
$_blockGroup
Definition:
Role.php:25
Magento\Framework\View\Element\AbstractBlock\getLayout
getLayout()
Definition:
AbstractBlock.php:295
Magento\User\Block\Role\getCreateUrl
getCreateUrl()
Definition:
Role.php:42
Magento\User\Block\Role\_construct
_construct()
Definition:
Role.php:32
Magento\Framework\View\Element\AbstractBlock\setChild
setChild($alias, $block)
Definition:
AbstractBlock.php:358