Extending Controllers

Spotsec has posted about Extending ZendControllerAction and keeping init() and everyone should read it!

Essentially he is saying that when you extend ZendControllerAction, you should put your initialisation code into the constructor rather than init(). The tricky bit is that ZendControllerAction’s constructor takes two parameters which people seem to forget about. If you don’t include them, then everything breaks.

We do this at work (and we use control+click to find the function signature, not google!)

Posted by Rob on 13th January 2008 under Around the web | Comments Off

Comments are closed.