【发布时间】:2012-08-08 02:46:03
【问题描述】:
我有一个页面,其中包含一些以编程方式包含的模板块,如下所示:
public function indexAction() {
$this->loadLayout();
$block = $this->getLayout()
->createBlock('core/template')
->setTemplate('somefolder/sometemplate.phtml');
$this->getLayout()->getBlock('content')->append($block);
$this->renderLayout();
}
我想在 sometemplate.phtml 里面放 $this->getChildHtml('somechild') 来插入另一个块。
我试过了
$box = $this->getLayout()
->createBlock('page/html')
->setTemplate('somefolder/somechild.phtml');
$block->append($box);
但它没有用。我该怎么做?
【问题讨论】:
标签: magento