On Mon, Jan 4, 2010 at 3:57 PM, Tomas Doran <[email protected]> wrote:
>
> the most important and useful thing you can forward to - an action
> directly.
>
> $c->forward($c->controller('
> Foo')->action_for('bar'), [...@args]);
>
While we're on the subject, there are certain levels of grok I'd like to
attain ;-)
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:
User.pm
User::Blog.pm
User::Blog::Entry.pm
After I add an entry to blog 'x' for user 'y', I can transport over to the
entries list for blog 'x' like so:
$c->forward($c->controller('My::Controller::User::Blog::Entry')->action_for('list'),
[ @args ]);
$c->detach;
Or less elegantly, like so:
$c->response->redirect($c->uri_for("/user/$user_id/blog/$blog_id/entry/list"));
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
]
);
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?
Thanks!
/dennis
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/