Base controller for all controllers in zend framework

ε祈祈猫儿з 提交于 2019-12-13 06:44:15

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!