我有两个名为"exe2"和"example"的自定义magento块 . exe2块使用getChildHtml函数获取示例块的内容,但它只保留向我返回空字符串,只有exe2内容使其进入屏幕 .

这是我的代码我的代码:

exe2 xml文件:

<layout version = "0.1.0">

<test_example_view>


    <block type = "exemplum_mod2/exe2" name = "exemplum.mod2.exe2"  template="exemplum/mod2/exe2.phtml">
        <reference name = "exemplum.mod2.exe2">
            <block type="exemplum/example" name="exemplum.example" template="exemplum/example1/example.phtml" />
        </reference>
    </block>


</test_example_view>

示例xml文件

<layout version="0.1.0">
<default>

    <block type="exemplum/example" name="exemplum.example" template="exemplum/example1/example.phtml" />        

</default>

这是包含getChildHtml调用的exe2 phtml文件:

<h1> 2nd </h1>
<?php

    echo $this->getMessage();
    echo $this->getChildHtml("exemplum.mod2.exe2");

?>

hello

example.phtml文件:

<h1>Hello there</h1>

最后是加载块的控制器文件:

<?php



class exemplum_example1_ExampleController extends Mage_Core_Controller_Front_Action{


    public function viewAction(){

        $this->loadLayout();

        $block = $this->getLayout()->createBlock('exemplum_mod2/exe2');
        $block->setTemplate("exemplum/mod2/exe2.phtml");


        $this->getLayout()->getBlock('content')->append($block);

        $this->renderLayout();

    }



}

在xml文件中添加一个块作为另一个块的子块的正确方法是什么?我在谷歌上找到的每个解决方案似乎都不适合我的情况所以我在这里做错了什么?