|
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Data Structures | |
| class | ElementTest |
| class | MergeTest |
Public Member Functions | |
| __construct (Layout\ProcessorFactory $processorFactory, ManagerInterface $eventManager, Layout\Data\Structure $structure, MessageManagerInterface $messageManager, Design\Theme\ResolverInterface $themeResolver, Layout\ReaderPool $readerPool, Layout\GeneratorPool $generatorPool, FrontendInterface $cache, Layout\Reader\ContextFactory $readerContextFactory, Layout\Generator\ContextFactory $generatorContextFactory, AppState $appState, Logger $logger, $cacheable=true, SerializerInterface $serializer=null) | |
| setGeneratorPool (Layout\GeneratorPool $generatorPool) | |
| setBuilder (Layout\BuilderInterface $builder) | |
| publicBuild () | |
| __destruct () | |
| getUpdate () | |
| generateXml () | |
| generateElements () | |
| getChildBlock ($parentName, $alias) | |
| setChild ($parentName, $elementName, $alias) | |
| reorderChild ($parentName, $childName, $offsetOrSibling, $after=true) | |
| unsetChild ($parentName, $alias) | |
| getChildNames ($parentName) | |
| getChildBlocks ($parentName) | |
| getChildName ($parentName, $alias) | |
| renderElement ($name, $useCache=true) | |
| renderNonCachedElement ($name) | |
| addToParentGroup ($blockName, $parentGroupName) | |
| getGroupChildNames ($blockName, $groupName) | |
| hasElement ($name) | |
| getElementProperty ($name, $attribute) | |
| isBlock ($name) | |
| isUiComponent ($name) | |
| isContainer ($name) | |
| isManipulationAllowed ($name) | |
| setBlock ($name, $block) | |
| unsetElement ($name) | |
| createBlock ($type, $name='', array $arguments=[]) | |
| addBlock ($block, $name='', $parent='', $alias='') | |
| renameElement ($oldName, $newName) | |
| getAllBlocks () | |
| getBlock ($name) | |
| getUiComponent ($name) | |
| getParentName ($childName) | |
| getElementAlias ($name) | |
| addOutputElement ($name) | |
| removeOutputElement ($name) | |
| getOutput () | |
| getMessagesBlock () | |
| getBlockSingleton ($type) | |
| addAdjustableRenderer ($namespace, $staticType, $dynamicType, $type, $template, $data=[]) | |
| getRendererOptions ($namespace, $staticType, $dynamicType) | |
| initMessages ($messageGroups=[]) | |
| isCacheable () | |
| isPrivate () | |
| setIsPrivate ($isPrivate=true) | |
| getReaderContext () | |
Public Member Functions inherited from Config | |
| __construct ($sourceData=null) | |
| setXml (Element $node) | |
| getNode ($path=null) | |
| getXpath ($xpath) | |
| getXmlString () | |
| loadFile ($filePath) | |
| loadString ($string) | |
| loadDom (\DOMNode $dom) | |
| setNode ($path, $value, $overwrite=true) | |
| applyExtends () | |
| processFileData ($text) | |
| extend (Config $config, $overwrite=true) | |
| __destruct () | |
Public Member Functions inherited from LayoutInterface | |
| addContainer ($name, $label, array $options=[], $parent='', $alias='') | |
Data Fields | |
| const | LAYOUT_NODE = '<layout/>' |
Protected Member Functions | |
| build () | |
| addToOutputRootContainers () | |
| displayElement ($name) | |
| _renderBlock ($name) | |
| _renderUiComponent ($name) | |
| _renderContainer ($name, $useCache=true) | |
| _prepareMessageGroup ($messageGroups) | |
| getXml () | |
Protected Member Functions inherited from Config | |
| getXml () | |
Protected Attributes | |
| $_update | |
| $_blocks = [] | |
| $_output = [] | |
| $sharedBlocks = [] | |
| $_renderingOutput | |
| $_renderElementCache = [] | |
| $structure | |
| $_renderers = [] | |
| $_eventManager | |
| $_processorFactory | |
| $messageManager | |
| $isPrivate = false | |
| $themeResolver | |
| $readerPool | |
| $cacheable | |
| $generatorPool | |
| $builder | |
| $cache | |
| $readerContextFactory | |
| $generatorContextFactory | |
| $readerContext | |
| $appState | |
| $logger | |
Protected Attributes inherited from Config | |
| $_xml = null | |
| $_elementClass = \Magento\Framework\Simplexml\Element::class | |
| $_xpathExtends = "//*[@extends]" | |
Layout model
@SuppressWarnings(PHPMD.ExcessiveClassComplexity) @SuppressWarnings(PHPMD.CouplingBetweenObjects) @SuppressWarnings(PHPMD.TooManyFields) @SuppressWarnings(PHPMD.ExcessivePublicCount) @SuppressWarnings(PHPMD.TooManyMethods) @SuppressWarnings(PHPMD.ExcessiveParameterList)
Definition at line 28 of file Layout.php.
| __construct | ( | Layout\ProcessorFactory | $processorFactory, |
| ManagerInterface | $eventManager, | ||
| Layout\Data\Structure | $structure, | ||
| MessageManagerInterface | $messageManager, | ||
| Design\Theme\ResolverInterface | $themeResolver, | ||
| Layout\ReaderPool | $readerPool, | ||
| Layout\GeneratorPool | $generatorPool, | ||
| FrontendInterface | $cache, | ||
| Layout\Reader\ContextFactory | $readerContextFactory, | ||
| Layout\Generator\ContextFactory | $generatorContextFactory, | ||
| AppState | $appState, | ||
| Logger | $logger, | ||
$cacheable = true, |
|||
| SerializerInterface | $serializer = null |
||
| ) |
| Layout\ProcessorFactory | $processorFactory | |
| ManagerInterface | $eventManager | |
| Layout\Data\Structure | $structure | |
| MessageManagerInterface | $messageManager | |
| Design\Theme\ResolverInterface | $themeResolver | |
| Layout\ReaderPool | $readerPool | |
| Layout\GeneratorPool | $generatorPool | |
| FrontendInterface | $cache | |
| Layout\Reader\ContextFactory | $readerContextFactory | |
| Layout\Generator\ContextFactory | $generatorContextFactory | |
| \Magento\Framework\App\State | $appState | |
| \Psr\Log\LoggerInterface | $logger | |
| bool | $cacheable | |
| SerializerInterface | null | $serializer |
Definition at line 190 of file Layout.php.
| __destruct | ( | ) |
Cleanup circular references between layout & blocks
Destructor should be called explicitly in order to work around the PHP bug https://bugs.php.net/bug.php?id=62468
Definition at line 272 of file Layout.php.
|
protected |
Validate message groups
| array | $messageGroups |
Definition at line 1079 of file Layout.php.
|
protected |
Gets HTML of block element
| string | $name |
Definition at line 554 of file Layout.php.
|
protected |
Gets HTML of container element
| string | $name | |
| bool | $useCache |
Definition at line 580 of file Layout.php.
|
protected |
| addAdjustableRenderer | ( | $namespace, | |
| $staticType, | |||
| $dynamicType, | |||
| $type, | |||
| $template, | |||
$data = [] |
|||
| ) |
| string | $namespace | |
| string | $staticType | |
| string | $dynamicType | |
| string | $type | |
| string | $template | |
| array | $data |
Definition at line 1003 of file Layout.php.
| addBlock | ( | $block, | |
$name = '', |
|||
$parent = '', |
|||
$alias = '' |
|||
| ) |
Add a block to registry, create new object if needed
| string | \Magento\Framework\View\Element\AbstractBlock | $block | |
| string | $name | |
| string | $parent | |
| string | $alias |
Implements LayoutInterface.
Definition at line 790 of file Layout.php.
| addOutputElement | ( | $name | ) |
Add an element to output
| string | $name |
Implements LayoutInterface.
Definition at line 924 of file Layout.php.
|
protected |
| addToParentGroup | ( | $blockName, | |
| $parentGroupName | |||
| ) |
Add element to parent group
| string | $blockName | |
| string | $parentGroupName |
Implements LayoutInterface.
Definition at line 615 of file Layout.php.
|
protected |
Build layout blocks from generic layouts and/or page configurations
Definition at line 250 of file Layout.php.
| createBlock | ( | $type, | |
$name = '', |
|||
| array | $arguments = [] |
||
| ) |
Block Factory
| string | $type | |
| string | $name | |
| array | $arguments |
Implements LayoutInterface.
Definition at line 755 of file Layout.php.
|
protected |
Define whether to display element Display if 'display' attribute is absent (false, null) or equal true ('1', true, 'true') In any other cases - do not display
| string | $name |
Definition at line 509 of file Layout.php.
| generateElements | ( | ) |
Create structure of elements from the loaded XML configuration
Implements LayoutInterface.
Definition at line 314 of file Layout.php.
| generateXml | ( | ) |
Layout xml generation
Implements LayoutInterface.
Definition at line 301 of file Layout.php.
| getAllBlocks | ( | ) |
Retrieve all blocks from registry as array
Implements LayoutInterface.
Definition at line 861 of file Layout.php.
| getBlock | ( | $name | ) |
Get block object by name
| string | $name |
Implements LayoutInterface.
Definition at line 873 of file Layout.php.
| getBlockSingleton | ( | $type | ) |
Get block singleton
| string | $type |
Implements LayoutInterface.
Definition at line 981 of file Layout.php.
| getChildBlock | ( | $parentName, | |
| $alias | |||
| ) |
Get child block if exists
| string | $parentName | |
| string | $alias |
Implements LayoutInterface.
Definition at line 372 of file Layout.php.
| getChildBlocks | ( | $parentName | ) |
Get list of child blocks
Returns associative array of <alias> => <block instance>="">
| string | $parentName |
Implements LayoutInterface.
Definition at line 450 of file Layout.php.
| getChildName | ( | $parentName, | |
| $alias | |||
| ) |
Get child name by alias
| string | $parentName | |
| string | $alias |
Implements LayoutInterface.
Definition at line 470 of file Layout.php.
| getChildNames | ( | $parentName | ) |
Get list of child names
| string | $parentName |
Implements LayoutInterface.
Definition at line 436 of file Layout.php.
| getElementAlias | ( | $name | ) |
Get element alias by name
| string | $name |
Implements LayoutInterface.
Definition at line 912 of file Layout.php.
| getElementProperty | ( | $name, | |
| $attribute | |||
| ) |
Get property value of an element
| string | $name | |
| string | $attribute |
Implements LayoutInterface.
Definition at line 653 of file Layout.php.
| getGroupChildNames | ( | $blockName, | |
| $groupName | |||
| ) |
Get element names for specified group
| string | $blockName | |
| string | $groupName |
Implements LayoutInterface.
Definition at line 628 of file Layout.php.
| getMessagesBlock | ( | ) |
Retrieve messages block
Implements LayoutInterface.
Definition at line 964 of file Layout.php.
| getOutput | ( | ) |
Get all blocks marked for output
Implements LayoutInterface.
Definition at line 949 of file Layout.php.
| getParentName | ( | $childName | ) |
Gets parent name of an element with specified name
| string | $childName |
Implements LayoutInterface.
Definition at line 900 of file Layout.php.
| getReaderContext | ( | ) |
Getter and lazy loader for reader context
Definition at line 1141 of file Layout.php.
| getRendererOptions | ( | $namespace, | |
| $staticType, | |||
| $dynamicType | |||
| ) |
| string | $namespace | |
| string | $staticType | |
| string | $dynamicType |
Definition at line 1019 of file Layout.php.
| getUiComponent | ( | $name | ) |
Get Ui Component object by name
| string | $name |
Definition at line 889 of file Layout.php.
| getUpdate | ( | ) |
Retrieve the layout update instance
Implements LayoutInterface.
Definition at line 287 of file Layout.php.
|
protected |
Getter and lazy loader for xml element
Definition at line 1128 of file Layout.php.
| hasElement | ( | $name | ) |
Check if element exists in layout structure
| string | $name |
Implements LayoutInterface.
Definition at line 640 of file Layout.php.
| initMessages | ( | $messageGroups = [] | ) |
Init messages by message storage(s), loading and adding messages to layout messages block
| string | array | $messageGroups |
Definition at line 1063 of file Layout.php.
| isBlock | ( | $name | ) |
Whether specified element is a block
| string | $name |
Implements LayoutInterface.
Definition at line 665 of file Layout.php.
| isCacheable | ( | ) |
Check is exists non-cacheable layout elements
Implements LayoutInterface.
Definition at line 1094 of file Layout.php.
| isContainer | ( | $name | ) |
Checks if element with specified name is container
| string | $name |
Implements LayoutInterface.
Definition at line 695 of file Layout.php.
| isManipulationAllowed | ( | $name | ) |
Whether the specified element may be manipulated externally
| string | $name |
Implements LayoutInterface.
Definition at line 710 of file Layout.php.
| isPrivate | ( | ) |
Check is exists non-cacheable layout elements
Definition at line 1106 of file Layout.php.
| isUiComponent | ( | $name | ) |
Whether specified element is a UI Component
| string | $name |
Definition at line 680 of file Layout.php.
| publicBuild | ( | ) |
| removeOutputElement | ( | $name | ) |
Remove an element from output
| string | $name |
Implements LayoutInterface.
Definition at line 936 of file Layout.php.
| renameElement | ( | $oldName, | |
| $newName | |||
| ) |
Rename element in layout and layout structure
| string | $oldName | |
| string | $newName |
Implements LayoutInterface.
Definition at line 842 of file Layout.php.
| renderElement | ( | $name, | |
$useCache = true |
|||
| ) |
Find an element in layout, render it and return string with its output
| string | $name | |
| bool | $useCache |
Implements LayoutInterface.
Definition at line 483 of file Layout.php.
| renderNonCachedElement | ( | $name | ) |
Render non cached element
| string | $name |
Definition at line 526 of file Layout.php.
| reorderChild | ( | $parentName, | |
| $childName, | |||
| $offsetOrSibling, | |||
$after = true |
|||
| ) |
Reorder a child of a specified element
If $offsetOrSibling is null, it will put the element to the end If $offsetOrSibling is numeric (integer) value, it will put the element after/before specified position Otherwise – after/before specified sibling
| string | $parentName | |
| string | $childName | |
| string | int | null | $offsetOrSibling | |
| bool | $after |
Implements LayoutInterface.
Definition at line 410 of file Layout.php.
| setBlock | ( | $name, | |
| $block | |||
| ) |
Save block in blocks registry
| string | $name | |
| \Magento\Framework\View\Element\AbstractBlock | $block |
Implements LayoutInterface.
Definition at line 724 of file Layout.php.
| setBuilder | ( | Layout\BuilderInterface | $builder | ) |
| setChild | ( | $parentName, | |
| $elementName, | |||
| $alias | |||
| ) |
Set child element into layout structure
| string | $parentName | |
| string | $elementName | |
| string | $alias |
Implements LayoutInterface.
Definition at line 390 of file Layout.php.
| setGeneratorPool | ( | Layout\GeneratorPool | $generatorPool | ) |
| Layout\GeneratorPool | $generatorPool |
Definition at line 229 of file Layout.php.
| setIsPrivate | ( | $isPrivate = true | ) |
Mark layout as private
| bool | $isPrivate |
Definition at line 1117 of file Layout.php.
| unsetChild | ( | $parentName, | |
| $alias | |||
| ) |
Remove child element from parent
| string | $parentName | |
| string | $alias |
Implements LayoutInterface.
Definition at line 423 of file Layout.php.
| unsetElement | ( | $name | ) |
Remove block from registry
| string | $name |
Implements LayoutInterface.
Definition at line 736 of file Layout.php.
|
protected |
Definition at line 48 of file Layout.php.
|
protected |
Definition at line 97 of file Layout.php.
|
protected |
Definition at line 55 of file Layout.php.
|
protected |
Definition at line 102 of file Layout.php.
|
protected |
Definition at line 76 of file Layout.php.
|
protected |
Definition at line 90 of file Layout.php.
|
protected |
Definition at line 69 of file Layout.php.
|
protected |
Definition at line 41 of file Layout.php.
|
protected |
Definition at line 162 of file Layout.php.
|
protected |
Definition at line 137 of file Layout.php.
|
protected |
Definition at line 142 of file Layout.php.
|
protected |
Definition at line 127 of file Layout.php.
|
protected |
Definition at line 152 of file Layout.php.
|
protected |
Definition at line 132 of file Layout.php.
Definition at line 112 of file Layout.php.
|
protected |
Definition at line 167 of file Layout.php.
|
protected |
Definition at line 107 of file Layout.php.
|
protected |
Definition at line 157 of file Layout.php.
|
protected |
Definition at line 147 of file Layout.php.
|
protected |
Definition at line 122 of file Layout.php.
|
protected |
Definition at line 62 of file Layout.php.
|
protected |
Definition at line 83 of file Layout.php.
|
protected |
Definition at line 117 of file Layout.php.
| const LAYOUT_NODE = '<layout/>' |
Empty layout xml
Definition at line 34 of file Layout.php.