I have a problem with displaying a view. When I pass var to view, view doesn't render.
Controller:
public function indexAction()
{
$branchModel = new Application_Model_Branches();
$branches = $branchModel->getAllBranches();
$this->view->menu = $branches;
}
View (index.phtml):
<h2>Menu</h2>
<?php
$this->htmlList($this->menu);
?>
When I try debug $branches
without assign it to view, all seems to be ok, but when I try push it to view,index.phtml don't appear.
Regards
controller
view
You're just missing an echo in your code, the
htmlList
view helper returns a value - it doesn't echo it. Some examples of the various form view helpers can be seen here