问题
I'm new to zend framework and I want to ask if is it possible to have a base controller that will be extended by all other controllers? I want to have a base class wherein I'll put all common methods and properties for all controllers I'll have on my project. Is it advisable to do this with zend or is there a better approach to this?
回答1:
You could just make a base class which extends Zend_Controller_Action. Then use that as the base class for all of your controllers.
Although, depending on what you want to do, it might be more appropriate to make Action helpers for the kind of functionality you want in every controller.
来源:https://stackoverflow.com/questions/1928662/base-controller-for-all-controllers-in-zend-framework