[Catalyst] Re: $c->visit without calling end()

Bill Moseley moseley at hank.org
Mon Nov 15 18:46:18 GMT 2010

On Mon, Nov 15, 2010 at 9:26 AM, Bill Crawford
<billcrawford1970 at gmail.com>wrote:

> > No, `forward` does not do a full redispatch. Most importantly,
> > if you=92re using chains in your app, then `visit` will walk the
> > entire chain to the action you passed and call those actions
> > (as well as all the `begin` and `auto` actions along the way),
> > while `forward` will only call the action itself.
> Erm, he was asking for something that doesn't "do a full dispatch" ?

There's two difference with calling forward. $c->forward does not use
passed-in captures, and it doesn't run:

 $action =3D $c->dispatcher->expand_action($action);

which, IIRC, turns an action into a chain of actions.   I haven't looked at
in in quite some time so probably worth looking at the source.

So, $c->visit will run through the chain but also runs auto and end.
 $c->forward just executes the action w/o auto and end, but if the action is
part of a chain and expand_action has not been run then it won't run the
chain.  Seem right?

What's the reason that forward doesn't expand the chain and set the

-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101115/41d7c=

More information about the Catalyst mailing list