Explain lifecycle of a Magento Block?

Q. Explain lifecycle of a Magento Block?

_prepareLayout() method is called immediately after a block has been added to the layout object for the first time.
_beforeToHtml() method is called immediately before a block’s HTML content is rendered.
_afterToHtml() method is called immediately after a block’s HTML content is generated.
_beforeChildToHtml() is called when a parent renders one of its children (through a call to $this->getChildHtml(‘name’)).

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Search