netlynx wrote:
> 
> The question that came to mind is Rob is checking for an identity in the
> preDispatch() method of the action controller --
> Zend_Auth::getInstance()->hasIdentity() --, and I am wondering if this
> wouldn’t be better located in the init() method of the action controller?
> 
> I guess what it really comes down to is without poking through the Zend
> Framework source code and api documentation too much, what ‘order’ does
> things happen in, and what are the best practices of what should go into
> the different methods.  Is there some kind of quick descriptions or maybe
> an application flow diagram of some sort that has been put together
> showing this?
> 

I would personally put this in a plugin so that you didn't have to mess with
your actions, that way the site and feature should work whether you have
auth or not (i.e. as different situations may arise).

It's specified in the manual under plugins and controllers (I believe) as to
what order the calls are made, but also someone did a chart the other day
which is here: 

http://www.nabble.com/Graph-showing-Action-Helpers,-Plugins-and-Controllers-lifecycle-along-dispatch-td20304504.html#a20613357

Or directly:

http://surlandia.com/2008/11/03/zend-framework-plugins-action-helpers-and-controllers-life-cycle-during-dispatch/

Which I think you will find very useful.

Simon

-----
Simon

http://www.ajb007.co.uk/
-- 
View this message in context: 
http://www.nabble.com/Best-Practices-Question-tp20805394p20808898.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to