|
|||
|
hey, i am using the modular structure and want to use it for the navigation. depending on which module is loaded, i want to change the navigation.
as i noticed that there is nothing like init() in controllers, i tried expanding zend_controller_module_abstract - but now i dont know how to interact with the view-object. |
|
|||
|
Please refer to Zend Framework Documentation. It says that there is a init() method in Zend_Controller_Action, which you can extend and its called after class constructor.
View object could be refered by $this->view property inside Zend_Controller_Action |
|
|||
|
You are on the right track with the init() function, and also right that there isn't one at the Module level. My solution would be to create a parent for all the controllers in your module, something like (where you put this class, and what you call it would depend on your module layout and if you care about autoload working or not)
Code:
abstract class MyModule_Controller_Abstract extends Zend_Controller_Action {
public function init() {
// do stuff
parent::init();
}
}
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|