Search code examples
phpzend-frameworkzend-view

How to use a partial in ZF?


I am trying to load a partial view in the index page. In order to do so in the index.phtml I have the following:

echo $this->partial('index/partials/categories.phtml', array('categoryFeed'=>$this->categoryFeed)); 

The problem is that when I load the partial, it will also load the header and footer (from the layout), so I will have index[header-partial[header-content-footer]-footer]. My question is, how can I load a partial in the homepage?


Solution

  • partial view helper clones current view object, clears assigned vars in cloned view and executes specified view script.

    It can't load additional header-footer-whatever. Check your partial view script.