开发者

Zend Framework: extend custom base controller from Zend_Controller_Action

开发者 https://www.devze.com 2023-02-15 06:02 出处:网络
I want my controller开发者_JAVA百科s to be extended from my base controller (no from Zend_Controller_Action).

I want my controller开发者_JAVA百科s to be extended from my base controller (no from Zend_Controller_Action).

How can I extend my base Contoller from Zend_Contoller_Action. And where this custom base controller to be placed so it will be accessible to other contollers.

Thanks in advance


To extend write:

abstract class Mylib_YourBaseController extends Zend_Contoller_Action{
}

Create a directory called Mylib in the same place the Zend library is, that's it.


My_Controller_Action extends Zend_Controller_Action { ... }

Place it in library/My/Controller/Action.php , then in you're app.ini ( or at bootstrap ) you need to register the namespace My , then all you're controllers can extend My_Controller_Action .

0

精彩评论

暂无评论...
验证码 换一张
取 消