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
framework
View
Page
Config
Reader
Body.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\View\Page\Config\Reader
;
7
8
use
Magento\Framework\View\Layout
;
9
use
Magento\Framework\View\Page\Config
as
PageConfig
;
10
14
class
Body
implements
Layout\ReaderInterface
15
{
19
const
TYPE_BODY
=
'body'
;
25
const
BODY_ATTRIBUTE
=
'attribute'
;
29
protected
$readerPool
;
30
36
public
function
__construct
(
Layout
\
ReaderPool
$readerPool
)
37
{
38
$this->readerPool =
$readerPool
;
39
}
40
46
public
function
getSupportedNodes
()
47
{
48
return
[
self::TYPE_BODY
];
49
}
50
58
public
function
interpret
(
59
Layout
\Reader\
Context
$readerContext,
60
Layout
\
Element
$bodyElement
61
) {
63
foreach
($bodyElement as
$element
) {
64
if
(
$element
->getName() ===
self::BODY_ATTRIBUTE
) {
65
$this->
setBodyAttributeToStructure
($readerContext,
$element
);
66
}
67
}
68
$this->readerPool->interpret($readerContext, $bodyElement);
69
return
$this;
70
}
71
79
protected
function
setBodyAttributeToStructure
(
Layout
\Reader\
Context
$readerContext,
Layout
\
Element
$element
)
80
{
81
if
(
$element
->getAttribute(
'name'
) == PageConfig::BODY_ATTRIBUTE_CLASS) {
82
$readerContext->getPageConfigStructure()->setBodyClass(
$element
->getAttribute(
'value'
));
83
}
else
{
84
$readerContext->getPageConfigStructure()->setElementAttribute(
85
PageConfig::ELEMENT_TYPE_BODY,
86
$element
->getAttribute(
'name'
),
87
$element
->getAttribute(
'value'
)
88
);
89
}
90
return
$this;
91
}
92
}
Magento\Framework\View\Page\Config\Reader\Body\setBodyAttributeToStructure
setBodyAttributeToStructure(Layout\Reader\Context $readerContext, Layout\Element $element)
Definition:
Body.php:79
Magento\Framework\View\Layout\ReaderInterface\interpret
interpret(Reader\Context $readerContext, Element $element)
Magento\Framework\View\Layout
Definition:
AclCondition.php:6
Magento\Framework\View\Page\Config
Magento\Framework\View\Page\Config\Reader\Body
Definition:
Body.php:14
Magento\Framework\View\Layout
Definition:
Layout.php:28
Magento\Framework\View\Page\Config\Reader
Definition:
Body.php:6
Magento\Framework\View\Layout\Element
Definition:
Element.php:14
Magento\Framework\View\Page\Config\Reader\Body\getSupportedNodes
getSupportedNodes()
Definition:
Body.php:46
Magento\Framework\View\Page\Config\Reader\Body\__construct
__construct(Layout\ReaderPool $readerPool)
Definition:
Body.php:36
Magento\Framework\View\Layout\ReaderPool
Definition:
ReaderPool.php:13
Magento\Framework\View\Context
Definition:
Context.php:32
Magento\Framework\View\Page\Config\Reader\Body\TYPE_BODY
const TYPE_BODY
Definition:
Body.php:19
Magento\Framework\View\Page\Config\Reader\Body\$readerPool
$readerPool
Definition:
Body.php:29
Magento\Framework\View\Page\Config\Reader\Body\BODY_ATTRIBUTE
const BODY_ATTRIBUTE
Definition:
Body.php:25
$element
$element
Definition:
element.phtml:12