[Catalyst-dev] RFC: $c->uri_for_chained

Ash Berlin ash at cpan.org
Tue Oct 17 13:28:26 CEST 2006


Right then,

Finally got annoyed with having to do the likes of (in TT):

c.uri_for(c.controller('Private').action_for('path'), 
c.req.captures.merge([test.id]), 'some', 'more', 'params')

cos you know - thats EVIL.

I propose a solution something like the following:

$c->uri_for_chained('/private/path', @{$c->req->captures}, $test->id, 
qw/some more params')

(Another possibility would be to have $action->uri_for or some 
derivation there of.)

Since Args/CaptureArgs attributes are specified (or defaulted) for 
chained actions it is possible to work out if this is valid, and if it 
is not it would throw an exception.

Seem sensible? Have I lost it?

Ash



More information about the Catalyst-dev mailing list