Magento – Difference Between getChildHtml and getChildBlock

blocksmagento-1.9magento2

In the description of the method of getChildHtml it is said "Retrieve child block HTML"
In the description of the getChildBlock method, it says "Retrieve child block by name".
But what is the difference?

Best Answer

As name suggest getChildHtml() render the HTML of block if it find the block and getChildBlock() will return only Block object it it find any block.

Related Topic