Answer the question
In order to leave comments, you need to log in
Custom Nested Blocks in Magento
I'm trying to implement childBlock in the main one in different ways. But in any case, it displays a set of some unreadable characters on the screen. What is it all about? Has anyone experienced this?
I just don't understand what's going on, any way produces such a result.
Method 1 directly in the template
$this->getLayout()->createBlock('core/template','template_name')->setTemplate('path/to/template.phtml'))->toHtml();
<block type="module/block" name="view" template="path/to/template.phtml">
<block type="module/block_question" name="view_question" as="question" template="path/to/subtemplate.phtml"/>
</block>
<?php echo $this->getChildHtml('question'); ?>
Answer the question
In order to leave comments, you need to log in
In general, the behavior is not clear when the time will definitely need to be picked. But the meaning is something like this, trying to treat some objects or their methods as a different data type.
Is caching disabled? Do the template file encodings match?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question