Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
LayoutInterface Interface Reference
Inheritance diagram for LayoutInterface:
Layout Generic Proxy Page Layout Tabs

Public Member Functions

 getUpdate ()
 
 generateXml ()
 
 generateElements ()
 
 renderElement ($name, $useCache=true)
 
 addOutputElement ($name)
 
 getOutput ()
 
 hasElement ($name)
 
 unsetElement ($name)
 
 getAllBlocks ()
 
 getBlock ($name)
 
 getChildBlock ($parentName, $alias)
 
 setChild ($parentName, $elementName, $alias)
 
 reorderChild ($parentName, $childName, $offsetOrSibling, $after=true)
 
 unsetChild ($parentName, $alias)
 
 getChildNames ($parentName)
 
 getChildBlocks ($parentName)
 
 getChildName ($parentName, $alias)
 
 addToParentGroup ($blockName, $parentGroupName)
 
 getGroupChildNames ($blockName, $groupName)
 
 getParentName ($childName)
 
 createBlock ($type, $name='', array $arguments=[])
 
 addBlock ($block, $name='', $parent='', $alias='')
 
 addContainer ($name, $label, array $options=[], $parent='', $alias='')
 
 renameElement ($oldName, $newName)
 
 getElementAlias ($name)
 
 removeOutputElement ($name)
 
 getMessagesBlock ()
 
 getBlockSingleton ($type)
 
 getElementProperty ($name, $attribute)
 
 isBlock ($name)
 
 isContainer ($name)
 
 isManipulationAllowed ($name)
 
 setBlock ($name, $block)
 
 isCacheable ()
 

Detailed Description

Interface LayoutInterface @api

Since
100.0.2

Definition at line 13 of file LayoutInterface.php.

Member Function Documentation

◆ addBlock()

addBlock (   $block,
  $name = '',
  $parent = '',
  $alias = '' 
)

Add a block to registry, create new object if needed

Parameters
string | \Magento\Framework\View\Element\AbstractBlock$block
string$name
string$parent
string$alias
Returns
Element\BlockInterface

Implemented in Layout, and Proxy.

◆ addContainer()

addContainer (   $name,
  $label,
array  $options = [],
  $parent = '',
  $alias = '' 
)

Insert container into layout structure

Parameters
string$name
string$label
array$options
string$parent
string$alias
Returns
void

Implemented in Proxy.

◆ addOutputElement()

addOutputElement (   $name)

Add an element to output

Parameters
string$name
Returns
LayoutInterface

Implemented in Layout, and Proxy.

◆ addToParentGroup()

addToParentGroup (   $blockName,
  $parentGroupName 
)

Add element to parent group

Parameters
string$blockName
string$parentGroupName
Returns
bool

Implemented in Layout, and Proxy.

◆ createBlock()

createBlock (   $type,
  $name = '',
array  $arguments = [] 
)

Block Factory

Parameters
string$type
string$name
array$arguments
Returns
Element\BlockInterface

Implemented in Layout, and Proxy.

◆ generateElements()

generateElements ( )

Create structure of elements from the loaded XML configuration

Returns
void

Implemented in Layout, and Proxy.

◆ generateXml()

generateXml ( )

Layout xml generation

Returns
LayoutInterface

Implemented in Layout, and Proxy.

◆ getAllBlocks()

getAllBlocks ( )

Retrieve all blocks from registry as array

Returns
array

Implemented in Layout, and Proxy.

◆ getBlock()

getBlock (   $name)

Get block object by name

Parameters
string$name
Returns
Element\BlockInterface|bool

Implemented in Layout, and Proxy.

◆ getBlockSingleton()

getBlockSingleton (   $type)

Get block singleton

Parameters
string$type
Returns
Element\BlockInterface

Implemented in Layout, and Proxy.

◆ getChildBlock()

getChildBlock (   $parentName,
  $alias 
)

Get child block if exists

Parameters
string$parentName
string$alias
Returns
null

Implemented in Layout, and Proxy.

◆ getChildBlocks()

getChildBlocks (   $parentName)

Get list of child blocks

Returns associative array of <alias> => <block instance>="">

Parameters
string$parentName
Returns
array

Implemented in Layout, and Proxy.

◆ getChildName()

getChildName (   $parentName,
  $alias 
)

Get child name by alias

Parameters
string$parentName
string$alias
Returns
bool|string

Implemented in Layout, and Proxy.

◆ getChildNames()

getChildNames (   $parentName)

Get list of child names

Parameters
string$parentName
Returns
array

Implemented in Layout, and Proxy.

◆ getElementAlias()

getElementAlias (   $name)

Get element alias by name

Parameters
string$name
Returns
bool|string

Implemented in Layout, and Proxy.

◆ getElementProperty()

getElementProperty (   $name,
  $attribute 
)

Get property value of an element

Parameters
string$name
string$attribute
Returns
mixed

Implemented in Layout, and Proxy.

◆ getGroupChildNames()

getGroupChildNames (   $blockName,
  $groupName 
)

Get element names for specified group

Parameters
string$blockName
string$groupName
Returns
array

Implemented in Layout, and Proxy.

◆ getMessagesBlock()

getMessagesBlock ( )

Retrieve messages block

Returns
\Magento\Framework\View\Element\Messages

Implemented in Layout, and Proxy.

◆ getOutput()

getOutput ( )

Get all blocks marked for output

Returns
string

Implemented in Layout, and Proxy.

◆ getParentName()

getParentName (   $childName)

Gets parent name of an element with specified name

Parameters
string$childName
Returns
bool|string

Implemented in Layout, and Proxy.

◆ getUpdate()

getUpdate ( )

Retrieve the layout processor

Returns
Layout\ProcessorInterface

Implemented in Layout, and Proxy.

◆ hasElement()

hasElement (   $name)

Check if element exists in layout structure

Parameters
string$name
Returns
bool

Implemented in Layout, and Proxy.

◆ isBlock()

isBlock (   $name)

Whether specified element is a block

Parameters
string$name
Returns
bool

Implemented in Layout, and Proxy.

◆ isCacheable()

isCacheable ( )

Check is exists non-cacheable layout elements

Returns
bool

Implemented in Layout, Proxy, and Layout.

◆ isContainer()

isContainer (   $name)

Checks if element with specified name is container

Parameters
string$name
Returns
bool

Implemented in Layout, and Proxy.

◆ isManipulationAllowed()

isManipulationAllowed (   $name)

Whether the specified element may be manipulated externally

Parameters
string$name
Returns
bool

Implemented in Layout, and Proxy.

◆ removeOutputElement()

removeOutputElement (   $name)

Remove an element from output

Parameters
string$name
Returns
LayoutInterface

Implemented in Layout, and Proxy.

◆ renameElement()

renameElement (   $oldName,
  $newName 
)

Rename element in layout and layout structure

Parameters
string$oldName
string$newName
Returns
bool

Implemented in Layout, and Proxy.

◆ renderElement()

renderElement (   $name,
  $useCache = true 
)

Find an element in layout, render it and return string with its output

Parameters
string$name
bool$useCache
Returns
string

Implemented in Layout, and Proxy.

◆ reorderChild()

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

Parameters
string$parentName
string$childName
string | int | null$offsetOrSibling
bool$after
Returns
void

Implemented in Layout, and Proxy.

◆ setBlock()

setBlock (   $name,
  $block 
)

Save block in blocks registry

Parameters
string$name
Element\BlockInterface$block
Returns
LayoutInterface

Implemented in Layout, and Proxy.

◆ setChild()

setChild (   $parentName,
  $elementName,
  $alias 
)

Set child element into layout structure

Parameters
string$parentName
string$elementName
string$alias
Returns
LayoutInterface

Implemented in Layout, and Proxy.

◆ unsetChild()

unsetChild (   $parentName,
  $alias 
)

Remove child element from parent

Parameters
string$parentName
string$alias
Returns
LayoutInterface

Implemented in Layout, and Proxy.

◆ unsetElement()

unsetElement (   $name)

Remove block from registry

Parameters
string$name
Returns
LayoutInterface

Implemented in Layout, and Proxy.


The documentation for this interface was generated from the following file: