Excellent, thanks. Where should I put that? As a super controller? Or in
my own library?

On Sun, 24 Jan 2010 11:40:02 -0800 (PST), "iSac [via Zend Framework
Community]" <[email protected]> said:
> 
> 
> 
> Make a base controller class that extends Zend_Controller_Action which
> has
> your aforementioned code in preDispatch. Have all your controllers extend
> this controller, and if they need their own preDispatch code make sure to
> call parent::preDispatch(). 
> 
> class Your_App_Controller_Action extends Zend_Controller_Action
> {
> 
>     public function preDispatch()
>     {
>         //your code
>     }
> 
> }
> 
> class PostController extends Your_App_Controller_Action
> {
>     //no new preDispatch logic, no need to call preDispatch, happens
> automatically
> }
> 
> class UserController extends Your_App_Controller_Action
> {
>     //new preDispatch logic, override but call parent::preDispatch()
>     public function preDispatch()
>     {
>         parent::preDispatch();
>         //other code
>     }
> 
> }
> 
> ______________________________________
> View message @
> http://n4.nabble.com/Same-predispatch-in-every-controller-Where-s-a-better-place-to-put-it-tp1288632p1288818.html
> 
> To unsubscribe from Same predispatch in every controller. Where's a
> better place to put it?, click
>  (link removed) ==

//
Corey H Maass
Gelform Design
Brooklyn, NY
Web design and development for art and business

em [email protected]
ww http://www.gelform.com
ph 646/228.5048
fx 866/502.4861
IM gelform
tw http://twitter.com/coreymaass
fb http://facebook.com/coreymaass


-- 
View this message in context: 
http://n4.nabble.com/Same-predispatch-in-every-controller-Where-s-a-better-place-to-put-it-tp1288632p1288891.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to