3

I want my controllers 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

1
  • 2
    I assume, of course, you are aware of the arguments in favor of action helpers, for example, this article from Matthew Weier O'Phinney: devzone.zend.com/article/3350 Commented Mar 6, 2011 at 12:34

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

you allso need to register the namespace Mylib.
I use the old autoloader - don't need complex stuff.
1
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 .

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.