2
我在显示视图时遇到了问题。当我传递var来查看时,视图不会呈现。Zend Framework,传递变量以查看
控制器:
public function indexAction()
{
$branchModel = new Application_Model_Branches();
$branches = $branchModel->getAllBranches();
$this->view->menu = $branches;
}
视图(index.phtml):
<h2>Menu</h2>
<?php
$this->htmlList($this->menu);
?>
当我尝试调试$branches
不分配它来查看,一切似乎是确定,但是当我试图将其推查看,index.phtml不会出现。
问候
你的代码看起来不错。如果你在你的index.phtml中var_dump($ this-> menu),这是否工作? – 2010-09-22 18:29:07