How To Implement A Sidebar In Zend Framework

- 1 answer

How do I implement a sidebar in Zend Framework? I know that I can use a placeholder or something similar in Zend_layout, but how do I automatically generate the code for the sidebar in my controllers without having to call a sidebar class within every controller? My setup is as follows

- modules
  - blog
  - other modules

I only want the sidebar for my blog module.

I have found this but I do not understand the last part "just inject your layout, register it with the front controller ..."



You could just have a action and view in one of your controllers which renders the sidebar.

from the layout for the blog module you just call:

<? echo $this->action('action','controller','module',array('optionalparams'=>1); ?>

on the position where you want to have it. So one call to one action.