Extending the IndexController with a BaseController in Zend

前端 未结 4 1564
眼角桃花
眼角桃花 2021-02-08 15:17

I\'m trying to extend my controllers with a global base controller as such:

class BaseController extends Zend_Controller_Action {
 // common controller actions
          


        
4条回答
  •  失恋的感觉
    2021-02-08 15:24

    Even more quicker solution (and conceptually more correct) is NOT to create base controllers at all:)

    You have common action? Use action helpers. You have some functionality that must be autorun? Use controller plugins.

    By design ZF controllers were made as flexible as possible, and limiting yourself by inheritance (and coupling it brings) is just not the best possible strategy.

提交回复
热议问题