[Catalyst] go to chained action

Alex Povolotsky tarkhil at over.ru
Thu Dec 17 15:41:29 GMT 2009


Tomas Doran wrote:
>
> 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 ] )
>
Sorry, this does not work QUITE as expected.

I'm forwarding() right now, and 
$c->forward($c->controller('MyController')->action_for('action_name'),[],[qw/argument/]) 
does not pass ALL chain. What's strange, I do see mention of chain base 
in log, but chain base never get called.

I could first forward to chain base manually, but that's not the thing 
I'm looking to.

Alex.




More information about the Catalyst mailing list