views:

51

answers:

1

Hello

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

+3  A: 

You're just missing an echo, the htmlList view helper returns content - it doesn't echo it. Some examples of the various form view helpers can be seen here

<h2>Menu</h2>
<?php
    echo $this->htmlList($this->menu);
?>
seengee