Hey, all. I feel like I must have missed something at some point, but has the
Dispatch process changed at some point? Here's what I remember:

1. Front Controller instantiates the Request, Response, Router, and
Dispatcher objects;
2. Dispatcher gets information about initial dispatch from Request and
Router;
3. Dispatcher instantiates the appropriate Controller object, which also
runs Controller->init();
3a. Dispatcher calls Controller->preDispatch();
3b. Dispatcher calls Controller->{$Request->getActionName()}Action();
3c. Dispatcher fields additional dispatch requests (a la
Controller->_forward()), repeat 3...
3d. Dispatcher calls Controller->postDispatch();
4. Dispatcher returns to Front Controller;
5. Front Controller outputs the Response.

This structure precedes the ActionStack, of course, but the important thing
to note is that the postDispatch (hook) method was not called until the
whole loop completed.

>From experience, it appears that postDispatch() is now executed after the
action resolves, prior to initiating the next loop (3c and 3d are switched).
The manual and the API docs don't clearly represent this, if this is the
case, although the routing diagram in the manual kinda does. The docs for
Controller::_forward() don't clearly indicate where the re-dispatching
occurs, either. :/

Somebody else please confirm this process! It's important to note the
difference... Personally, I'd much rather see Controller::_forward()
interrupt the dispatch loop (as it used to) and ActionStack preserve it,
even if that means I write Zend_Controller_Action_Helper_Forwarder (a la
Redirector) to do so. I'm not certain there's a method to do so, however, as
the docs on plugins and helpers are a little vague on the subject as well.

Is there an authoritative resource somewhere on how the dispatch loop
actually operates? I've done a little snooping about on the Wiki, and there
are pieces from the 1.1 revision that reference the new Router scheme and
possible changes to the looping process, but I haven't found that one page
that says "this is how we do it" yet... Thanks...!

David @ OrlandoPHP.org
-- 
View this message in context: 
http://www.nabble.com/Reagrding-the-current-Dispatch-process...-tp18635886p18635886.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to