views:

117

answers:

2

I'm not 100% sure how to phrase this question so please help me if you can.

I have a system with modules that can be installed. I check if each module has a MenuController and if so I push an action onto the stack. The problem becomes that in each MenuController, if I don't use $this->render('index.phtml', 'menu'); then the output goes into the body. Is there some way that I can specify that the output for the menu controllers should go into the 'menu' section by default?

A: 

in MenuController use $this->_helper->viewrenderer->setResponseSegment('sth'); in preDispatch() :)

Tomáš Fejfar
This actually doesn't work as the viewRenderer state is reset with each controller init. I'm calling multiple MenuController(s), one for each module.
smack0007
Predispatch method of controller is called before EVERY dispatching of the controller...
Tomáš Fejfar
Yes, but I don't extend from a common base controller and the viewRenderer state gets reset after a plugin's preDispatch. I would have to put it in the preDispatch of every MenuController and that's more work than just passing it as a param.
smack0007
A: 

I ended up just extending Zend_Controller_Request_Http and adding methods for DefaultName().

smack0007