Mage_Core_Model_Layout
extends Config
in package
Maho
Tags
Table of Contents
Properties
- $_area : string
- Layout area (f.e. admin, frontend)
- $_blocks : array<string|int, mixed>
- Blocks registry
- $_cache : Mage_Core_Model_Cache
- Cache resource object
- $_cacheChecksum : string|false|null
- $_cacheId : string
- $_cacheLifetime : int
- $_cacheSaved : bool
- $_cacheTags : array<string|int, mixed>
- $_directOutput : bool
- Flag to have blocks' output go directly to browser as oppose to return result
- $_elementClass : string
- Class name of simplexml elements for this configuration
- $_helpers : array<string|int, mixed>
- Helper blocks cache for this layout
- $_output : array<string|int, mixed>
- Cache of block callbacks to output during rendering
- $_update : Mage_Core_Model_Layout_Update
- Layout Update module
- $_xml : Element|SimpleXMLElement|null
- Configuration xml
- $_xpathExtends : mixed
- Xpath describing nodes in configuration that need to be extended
- $invalidActions : mixed
Methods
- __construct() : mixed
- Class constructor
- addBlock() : Mage_Core_Block_Abstract
- Add a block to registry, create new object if needed
- addOutputBlock() : $this
- Add a block to output
- applyExtends() : $this
- Process configuration xml
- createBlock() : Mage_Core_Block_Abstract|false
- Block Factory
- extend() : $this
- fetchCacheChecksum() : bool
- findTranslationModuleName() : string
- Lookup module name for translation from current specified layout node
- generateBlocks() : mixed
- Create layout blocks hierarchy from layout xml configuration
- generateXml() : $this
- Loyout xml generation
- getAllBlocks() : array<string|int, Mage_Core_Block_Abstract>
- Retrieve all blocks from registry as array
- getArea() : string
- Retrieve layout area
- getBlock() : Mage_Core_Block_Abstract|false
- Get block object by name
- getBlockSingleton() : Mage_Core_Block_Abstract|stdClass
- getCache() : Mage_Core_Model_Cache
- getCacheChecksum() : string|false|null
- getCacheChecksumId() : string
- getCacheId() : string
- getCacheLifetime() : int
- getCacheSaved() : bool
- getCacheTags() : array<string|int, mixed>
- getDirectOutput() : bool
- Retrieve derect output flag
- getMessagesBlock() : Mage_Core_Block_Messages
- Retrieve messages block
- getNode() : Element|false
- Returns node found by the $path
- getOutput() : string
- Get all blocks marked for output
- getUpdate() : Mage_Core_Model_Layout_Update
- Layout update instance
- getXmlString() : string
- Return Xml of node as string
- getXpath() : array<string|int, Element>|false
- Returns nodes found by xpath expression
- helper() : Mage_Core_Helper_Abstract|false
- Retrieve helper object
- loadCache() : bool
- loadDom() : bool
- Imports DOM node
- loadFile() : bool
- Imports XML file
- loadString() : bool
- Imports XML string
- processFileData() : string
- Stub method for processing file data right after loading the file text
- removeCache() : $this
- removeOutputBlock() : $this
- saveCache() : $this
- setArea() : Mage_Core_Model_Layout
- Set layout area
- setBlock() : $this
- Save block in blocks registry
- setCache() : self
- setCacheChecksum() : $this
- setCacheId() : $this
- setCacheLifetime() : $this
- setCacheSaved() : $this
- setCacheTags() : $this
- setDirectOutput() : Mage_Core_Model_Layout
- Declaring layout direct output flag
- setNode() : $this
- Create node by $path and set its value.
- setXml() : $this
- Sets xml for this configuration
- unsetBlock() : $this
- Remove block from registry
- updateCacheChecksum() : $this
- validateCacheChecksum() : bool
- _generateAction() : $this
- _generateBlock() : $this
- Add block object to layout based on xml node data
- _getBlockInstance() : Mage_Core_Block_Abstract
- Create block object instance based on block type
- _loadCache() : bool
- _removeCache() : mixed
- _saveCache() : bool
- _translateLayoutNode() : mixed
- Translate layout node
- validateAgainstBlacklist() : mixed
Properties
$_area
Layout area (f.e. admin, frontend)
protected
string
$_area
$_blocks
Blocks registry
protected
array<string|int, mixed>
$_blocks
= []
$_cache
Cache resource object
protected
Mage_Core_Model_Cache
$_cache
= null
$_cacheChecksum
protected
string|false|null
$_cacheChecksum
= false
$_cacheId
protected
string
$_cacheId
= null
$_cacheLifetime
protected
int
$_cacheLifetime
= null
$_cacheSaved
protected
bool
$_cacheSaved
= false
$_cacheTags
protected
array<string|int, mixed>
$_cacheTags
= []
$_directOutput
Flag to have blocks' output go directly to browser as oppose to return result
protected
bool
$_directOutput
= \false
$_elementClass
Class name of simplexml elements for this configuration
protected
string
$_elementClass
= \Maho\Simplexml\Element::class
$_helpers
Helper blocks cache for this layout
protected
array<string|int, mixed>
$_helpers
= []
$_output
Cache of block callbacks to output during rendering
protected
array<string|int, mixed>
$_output
= []
$_update
Layout Update module
protected
Mage_Core_Model_Layout_Update
$_update
$_xml
Configuration xml
protected
Element|SimpleXMLElement|null
$_xml
= null
$_xpathExtends
Xpath describing nodes in configuration that need to be extended
protected
mixed
$_xpathExtends
= '//*[@extends]'
Tags
$invalidActions
protected
mixed
$invalidActions
= [
// explicitly not using class constant here Mage_Page_Block_Html_Topmenu_Renderer::class
// if the class does not exists it breaks.
['block' => 'Mage_Page_Block_Html_Topmenu_Renderer', 'method' => 'render'],
['block' => 'Mage_Core_Block_Template', 'method' => 'fetchview'],
]
Methods
__construct()
Class constructor
public
__construct() : mixed
addBlock()
Add a block to registry, create new object if needed
public
addBlock(string|Mage_Core_Block_Abstract $block, string $blockName) : Mage_Core_Block_Abstract
Parameters
- $block : string|Mage_Core_Block_Abstract
- $blockName : string
Return values
Mage_Core_Block_AbstractaddOutputBlock()
Add a block to output
public
addOutputBlock(string $blockName[, string $method = 'toHtml' ]) : $this
Parameters
- $blockName : string
- $method : string = 'toHtml'
Return values
$thisapplyExtends()
Process configuration xml
public
applyExtends() : $this
Return values
$thiscreateBlock()
Block Factory
public
createBlock(string|Mage_Core_Block_Abstract $type[, string $name = '' ][, array<string|int, mixed> $attributes = [] ]) : Mage_Core_Block_Abstract|false
Parameters
- $type : string|Mage_Core_Block_Abstract
- $name : string = ''
- $attributes : array<string|int, mixed> = []
Return values
Mage_Core_Block_Abstract|falseextend()
public
extend(Config $config[, bool $overwrite = true ]) : $this
Parameters
- $config : Config
- $overwrite : bool = true
Return values
$thisfetchCacheChecksum()
public
fetchCacheChecksum() : bool
Return values
boolfindTranslationModuleName()
Lookup module name for translation from current specified layout node
public
static findTranslationModuleName(Varien_Simplexml_Element $node) : string
Priorities:
- "module" attribute in the element
- "module" attribute in any ancestor element
- layout handle name - first 1 or 2 parts (namespace is determined automatically)
Parameters
- $node : Varien_Simplexml_Element
Return values
stringgenerateBlocks()
Create layout blocks hierarchy from layout xml configuration
public
generateBlocks([Mage_Core_Model_Layout_Element|Varien_Simplexml_Element|null $parent = null ]) : mixed
Parameters
- $parent : Mage_Core_Model_Layout_Element|Varien_Simplexml_Element|null = null
generateXml()
Loyout xml generation
public
generateXml() : $this
Return values
$thisgetAllBlocks()
Retrieve all blocks from registry as array
public
getAllBlocks() : array<string|int, Mage_Core_Block_Abstract>
Return values
array<string|int, Mage_Core_Block_Abstract>getArea()
Retrieve layout area
public
getArea() : string
Return values
stringgetBlock()
Get block object by name
public
getBlock(string $name) : Mage_Core_Block_Abstract|false
Parameters
- $name : string
Return values
Mage_Core_Block_Abstract|falsegetBlockSingleton()
public
getBlockSingleton(string $type) : Mage_Core_Block_Abstract|stdClass
Parameters
- $type : string
Tags
Return values
Mage_Core_Block_Abstract|stdClassgetCache()
public
getCache() : Mage_Core_Model_Cache
Return values
Mage_Core_Model_CachegetCacheChecksum()
public
getCacheChecksum() : string|false|null
Return values
string|false|nullgetCacheChecksumId()
public
getCacheChecksumId() : string
Return values
stringgetCacheId()
public
getCacheId() : string
Return values
stringgetCacheLifetime()
public
getCacheLifetime() : int
Return values
intgetCacheSaved()
public
getCacheSaved() : bool
Return values
boolgetCacheTags()
public
getCacheTags() : array<string|int, mixed>
Return values
array<string|int, mixed>getDirectOutput()
Retrieve derect output flag
public
getDirectOutput() : bool
Return values
boolgetMessagesBlock()
Retrieve messages block
public
getMessagesBlock() : Mage_Core_Block_Messages
Return values
Mage_Core_Block_MessagesgetNode()
Returns node found by the $path
public
getNode([string $path = null ]) : Element|false
Parameters
- $path : string = null
Tags
Return values
Element|falsegetOutput()
Get all blocks marked for output
public
getOutput() : string
Return values
stringgetUpdate()
Layout update instance
public
getUpdate() : Mage_Core_Model_Layout_Update
Return values
Mage_Core_Model_Layout_UpdategetXmlString()
Return Xml of node as string
public
getXmlString() : string
Return values
stringgetXpath()
Returns nodes found by xpath expression
public
getXpath(string $xpath) : array<string|int, Element>|false
Parameters
- $xpath : string
Return values
array<string|int, Element>|falsehelper()
Retrieve helper object
public
helper(string $name) : Mage_Core_Helper_Abstract|false
Parameters
- $name : string
Return values
Mage_Core_Helper_Abstract|falseloadCache()
public
loadCache() : bool
Return values
boolloadDom()
Imports DOM node
public
loadDom(DOMNode $dom) : bool
Parameters
- $dom : DOMNode
Return values
boolloadFile()
Imports XML file
public
loadFile(string $filePath) : bool
Parameters
- $filePath : string
Return values
boolloadString()
Imports XML string
public
loadString(string $string) : bool
Parameters
- $string : string
Return values
boolprocessFileData()
Stub method for processing file data right after loading the file text
public
processFileData(string $text) : string
Parameters
- $text : string
Return values
stringremoveCache()
public
removeCache() : $this
Return values
$thisremoveOutputBlock()
public
removeOutputBlock(string $blockName) : $this
Parameters
- $blockName : string
Return values
$thissaveCache()
public
saveCache([array<string|int, mixed> $tags = null ]) : $this
Parameters
- $tags : array<string|int, mixed> = null
Return values
$thissetArea()
Set layout area
public
setArea(string $area) : Mage_Core_Model_Layout
Parameters
- $area : string
Return values
Mage_Core_Model_LayoutsetBlock()
Save block in blocks registry
public
setBlock(string $name, Mage_Core_Block_Abstract $block) : $this
Parameters
- $name : string
- $block : Mage_Core_Block_Abstract
Return values
$thissetCache()
public
setCache(Mage_Core_Model_Cache $cache) : self
Parameters
- $cache : Mage_Core_Model_Cache
Return values
selfsetCacheChecksum()
public
setCacheChecksum(string|null $data) : $this
Parameters
- $data : string|null
Return values
$thissetCacheId()
public
setCacheId(string $id) : $this
Parameters
- $id : string
Return values
$thissetCacheLifetime()
public
setCacheLifetime(int $lifetime) : $this
Parameters
- $lifetime : int
Return values
$thissetCacheSaved()
public
setCacheSaved(bool $flag) : $this
Parameters
- $flag : bool
Return values
$thissetCacheTags()
public
setCacheTags(array<string|int, mixed> $tags) : $this
Parameters
- $tags : array<string|int, mixed>
Return values
$thissetDirectOutput()
Declaring layout direct output flag
public
setDirectOutput(bool $flag) : Mage_Core_Model_Layout
Parameters
- $flag : bool
Return values
Mage_Core_Model_LayoutsetNode()
Create node by $path and set its value.
public
setNode(string $path, string $value[, bool $overwrite = true ]) : $this
Parameters
- $path : string
-
separated by slashes
- $value : string
- $overwrite : bool = true
Return values
$thissetXml()
Sets xml for this configuration
public
setXml(Element $node) : $this
Parameters
- $node : Element
Return values
$thisunsetBlock()
Remove block from registry
public
unsetBlock(string $name) : $this
Parameters
- $name : string
Return values
$thisupdateCacheChecksum()
public
updateCacheChecksum(string|false $data) : $this
Parameters
- $data : string|false
Return values
$thisvalidateCacheChecksum()
public
validateCacheChecksum() : bool
Return values
bool_generateAction()
protected
_generateAction(Varien_Simplexml_Element $node, Mage_Core_Model_Layout_Element|Varien_Simplexml_Element $parent) : $this
Parameters
- $node : Varien_Simplexml_Element
- $parent : Mage_Core_Model_Layout_Element|Varien_Simplexml_Element
Return values
$this_generateBlock()
Add block object to layout based on xml node data
protected
_generateBlock(Varien_Simplexml_Element $node, Mage_Core_Model_Layout_Element|Varien_Simplexml_Element $parent) : $this
Parameters
- $node : Varien_Simplexml_Element
- $parent : Mage_Core_Model_Layout_Element|Varien_Simplexml_Element
Return values
$this_getBlockInstance()
Create block object instance based on block type
protected
_getBlockInstance(string $type[, array<string|int, mixed> $attributes = [] ]) : Mage_Core_Block_Abstract
Parameters
- $type : string
- $attributes : array<string|int, mixed> = []
Tags
Return values
Mage_Core_Block_Abstract_loadCache()
protected
_loadCache(string $id) : bool
Parameters
- $id : string
Return values
bool_removeCache()
protected
_removeCache(string $id) : mixed
Parameters
- $id : string
Tags
_saveCache()
protected
_saveCache(string $data, string $id[, array<string|int, mixed> $tags = [] ][, int|bool $lifetime = false ]) : bool
Parameters
- $data : string
- $id : string
- $tags : array<string|int, mixed> = []
- $lifetime : int|bool = false
Return values
bool_translateLayoutNode()
Translate layout node
protected
_translateLayoutNode(Varien_Simplexml_Element $node, array<string|int, mixed> &$args) : mixed
Parameters
- $node : Varien_Simplexml_Element
- $args : array<string|int, mixed>
validateAgainstBlacklist()
protected
validateAgainstBlacklist(Mage_Core_Block_Abstract $block, string $method, array<string|int, string> $args) : mixed
Parameters
- $block : Mage_Core_Block_Abstract
- $method : string
- $args : array<string|int, string>