我正在尝试使用zf2
.
我正在使用标准zf2
的骨架应用程序。
在我的IndexController
:
public function indexAction()
{
$view = new ViewModel();
$view->setTemplate('application/index/index.phtml');
$aboutView = new ViewModel();
$aboutView->setTemplate('application/index/about.phtml'); //standard html
$view->addChild($aboutView, 'about');
return $view;
}
在我的layout.phtml
中,我添加了以下代码:
HTML 代码:
echo $this->content
HTML 代码:
echo $this->about;
嵌套视图未显示在结果中。什么时候var_dump($this->about)
,我得到NULL.
知道我做错了什么吗?