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-theme
Model
Layout
Source
Layout.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Theme\Model\Layout\Source
;
7
8
class
Layout
implements
\Magento\Framework\Option\ArrayInterface
9
{
13
protected
$_config
;
14
18
public
function
__construct
(\
Magento
\
Theme
\Model\
Layout
\
Config
$config
)
19
{
20
$this->_config =
$config
;
21
}
22
28
protected
$_options
=
null
;
29
34
protected
$_defaultValue
=
null
;
35
41
public
function
getOptions
()
42
{
43
if
($this->_options ===
null
) {
44
$this->_options = [];
45
foreach
($this->_config->getPageLayouts() as $layout) {
46
$this->_options[$layout->getCode()] = $layout->getLabel();
47
if
($layout->getIsDefault()) {
48
$this->_defaultValue = $layout->getCode();
49
}
50
}
51
}
52
53
return
$this->_options
;
54
}
55
62
public
function
toOptionArray
($withEmpty =
false
)
63
{
64
$options
= [];
65
66
foreach
($this->
getOptions
() as
$value
=>
$label
) {
67
$options
[] = [
'label'
=>
$label
,
'value'
=>
$value
];
68
}
69
70
if
($withEmpty) {
71
array_unshift(
$options
, [
'value'
=>
''
,
'label'
=>
__
(
'-- Please Select --'
)]);
72
}
73
74
return
$options
;
75
}
76
81
public
function
getDefaultValue
()
82
{
83
$this->
getOptions
();
84
return
$this->_defaultValue
;
85
}
86
}
Magento\Theme\Model\Theme
Definition:
Theme.php:36
Magento\Theme\Model\Layout\Source\Layout\__construct
__construct(\Magento\Theme\Model\Layout\Config $config)
Definition:
Layout.php:18
Magento\Theme\Model\Layout\Source\Layout\getOptions
getOptions()
Definition:
Layout.php:41
Magento\Theme\Model\Layout\Source\Layout\$_options
$_options
Definition:
Layout.php:28
$config
$config
Definition:
fraud_order.php:17
Magento\Theme\Model\Layout\Source\Layout\$_defaultValue
$_defaultValue
Definition:
Layout.php:34
Magento\Theme\Model\Layout\Source\Layout\$_config
$_config
Definition:
Layout.php:13
Magento\Theme\Model\Layout\Source\Layout\getDefaultValue
getDefaultValue()
Definition:
Layout.php:81
__
__()
Definition:
__.php:13
Magento\Framework\Option\ArrayInterface
Definition:
ArrayInterface.php:11
Magento\Theme\Model\Layout\Source\Layout
Definition:
Layout.php:8
$label
$label
Definition:
details.phtml:21
$value
$value
Definition:
gender.phtml:16
Magento\Theme\Model\Layout\Source
Definition:
Layout.php:6
Magento\Theme\Model\Layout\Source\Layout\toOptionArray
toOptionArray($withEmpty=false)
Definition:
Layout.php:62
Magento
Magento\Theme\Model\Layout\Config
Definition:
Config.php:11
$options
$options
Definition:
multiple_mixed_products.php:29