1

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?

  • You can accept the answer by tick marking near to answer If it helps you :) – Keyur Shah May 7 '18 at 10:03
  • Thanks, but for this we need to call the object of the child block? – Evgeniy Kapelko May 7 '18 at 10:43
  • No you just need to pass block name which you can find it from layout XML file – Keyur Shah May 7 '18 at 10:51
  • I wanted to say, for what purposes do we need to call a block object? – Evgeniy Kapelko May 7 '18 at 11:06
  • It's up to your requirements :) – Keyur Shah May 7 '18 at 11:17
3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.