What exactly is the "as
" attribute in <container>
for in a layout xml?
When do I need to reference this one contrary to "name
"?
<container name="sidebar.additional" as="sidebar_additional" label="Sidebar Additional"/>
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityWhat exactly is the "as
" attribute in <container>
for in a layout xml?
When do I need to reference this one contrary to "name
"?
<container name="sidebar.additional" as="sidebar_additional" label="Sidebar Additional"/>
The name
attribute is unique and will serve to merge layouts together.
The as
is a short way for the same block, has to be unique in context, and can serve to get the block.
For exemple (in \Magento\Framework\View\Element\AbstractBlock::getChildBlock
) :
$this->getChildBlock('search_result_list');