How to call getChildHtml from my module in magento

I created a module and block

<block type="mymodule/mymodule" name="my_block" template="mymodule/mymodule.phtml"/>.

in the default .xml directory.

I call this block with the getChildHtml ('my_block') method from the default theme /product/view.phtml directory and display the text from the mymodule.phtml file, but I don’t want to call this block from view.phtml above the .phtml view, is there any way call this block anywhere from mymodule to display text from mymodule.phtml.

+5
source share
2 answers

If you want to call your block without using getChildHtml (), you need to put your block in a block of content such as left, right, content, etc., and it will be automatically rendered.

0
source

getChildHtml() HTML , .

, , , , .

,

<?php echo $this->getChildHtml('my_block') ?>
0

All Articles