[Catalyst] proper flow control with $c->foward, in search of
bobtfish at bobtfish.net
Fri Jan 8 14:55:43 GMT 2010
Dennis Daupert wrote:
> It seems that when chained path parts increase beyond two links,
> addressing actions directly doesn't work quite as well. For example, I
> have these:
> After I add an entry to blog 'x' for user 'y', I can transport over to
> the entries list for blog 'x' like so:
> [ @args ]);
Right, but forward visits _one action_, only..
> Or less elegantly, like so:
Eww, don't do that.
And it should be noted that redirect and forward are _totally_ different
things, used for totally different purposes.
> But I can't seem to _go_ to the list (this doesn't work -- I get
> 'invalid ID'):
> $c->go( 'My::Controller::User::Blog::Entry', 'list', [ \@captures,
> \@args ] );
Not specific enough. You get 'invalid ID' where, from what?
Please show use the debug table from app startup and for the hit in
question which has the issue?
At a guess what you're doing wrong is not ->go ing to the end of the
chain - you can _only_ go to chain endpoints (rather than individual
actions) as go does a full redispatch.
> Are there built-in limits to number of chained links we can dispatch by
> way of directly addressing actions?
> Any rules/tips/guidelines in
> multiple chained situations?
DO NOT CONSTRUCT PATHS MANUALLY.
USE ACTION OBJECTS OR uri_for_action.
That is all :)
More information about the Catalyst