On 16 Dec 2009, at 13:18, Alex Povolotsky wrote:

Hello!

Having, for example, /controller/*/action handled by /controller/ base (1) => /controller/action, how do I write correct go to / controller/argument/action ?

just $c->go('/controller/argument/action') does not work. $c->go('/ controller/action', [qw(argument)]) does not work as well, while $c- >detach('/controller/action', [qw(argument)]) seems to be working.

Actually, I'm looking for some kind of internal redirect.

Try $c->go($c->controller('MyController')->action_for('action_name'), [], [qw/ argument /]);

The go method is documented as:

$c->go( $action [, \...@captures, \...@arguments ] )
$c->go( $class, $method, [, \...@captures, \...@arguments ] )

So what you're trying is documented as not working :)

You _may_ get away with
Try $c->go($c->controller('MyController')->action_for('action_name'), [qw/ argument /]);

(i.e. omitting the captures if you only want args), but I'm unsure about that.

Cheers
t0m


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to