[Catalyst] another newbie chaining question

Matt S Trout dbix-class at trout.me.uk
Thu Sep 7 16:24:33 CEST 2006


John Napiorkowski wrote:
> Some debug info on this.
> 
> In my action I have:
> 
> my @actions = @{$c->action->chain};
> 	
> my $previous = $#actions-1;
> my $previous_action = $actions[$previous];
> 	
> $c->log->dumper($previous_action);
> 
> $c->log->dumper($c->uri_for($previous_action,
> $c->request->captures));
> 
> And this is what I get from the debug console:
> 
> [debug] $VAR1 = bless( {
>                  'attributes' => {
>                                    'CaptureArgs' => [
>                                                      
> 0
>                                                     ],
>                                    'Chained' => [
>                                                   '/'
>                                                 ],
>                                    'PartPath' => [
>                                                   
> 'templates'
>                                                  ]
>                                  },
>                  'class' =>
> 'services::Controller::templates',
>                  'code' => sub { "DUMMY" },
>                  'name' => 'templates',
>                  'namespace' => 'templates',
>                  'reverse' => 'templates/templates'
>                }, 'Catalyst::Action' );
> 
> [debug] $VAR1 = undef;
> 
> So it appears I got the right action object but I
> can't seem to get the URI for it.  Does this have
> something to do with that fact it may not have fully
> dispatched yet?

Erm, that action has no URI - it's an action with CaptureArgs so it can only 
exist as *part* of a chain, not as the endpoint of one.

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list