07 Jul Call a Block in file layout .xml in Magento
Call a Block in file layout .xml in Magento
<block type=”” name=”” as=”” template=””>
For example analyze syntax declare a Block :
<block type=”page/html” name=”root” output=”toHtml” template=”example/view.phtml”> (1)
analyze sections code,if we see general type = “A / B”, then:
A: Module Name, (1) => page <=> Mage_Page_Block
– Module is declared at:app/code/core/Mage/Page/etc/config.xml
B: Class name of Module A, (1) => html => Mage_Page_Block_Html Class
– To declare in:app/code/core/Mage/Page/Block/Html.php
Note:details about properties declare in Block on type:
* type:Block type,may be Block in Magento, or block in one module certain
* name:The name referrence to Block,this name sole right throughout the website, the block Other Reference to it by name.
* as:Name of Block or Block child, This name block by mode getChildHTML (‘name’) in file template corresponding with Block.
* template:file with extension.phtml,regulations content inside the block,in template may Calls to the other Block (Child Block orany Block that has been declared with Magento)