Charles Yeung
Charles Yeung

Reputation: 38805

Magento XML layout

In the code above, what is the meaning of placing "as="footer_links"?

Upvotes: 4

Views: 176

Answers (1)

Joe Mastey
Joe Mastey

Reputation: 27119

The as="x" syntax defines a name that templates can use to invoke a block. So, for the following:

<block type="text/html" name="outer_block" as="outer_block" template="outer_block.phtml">
    <block type="text/html" name="inner_block" as="inner_block" template="inner_block.phtml">
</block>

Inside of outer_block.phtml, you can invoke this to render inner_block.phtml:

<?php print $this->getChildHtml("inner_block"); ?>

Hope that helps!

Thanks, Joe

Upvotes: 4

Related Questions