X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FActionChain.pm;h=6d161045f636a9561efe5d3bff3f8f786e95caf1;hb=d4f67841aca20946ee3e6e32609a22d633d961e9;hp=ceb7c81abbf3e41e8ba4e39e77fd9363aa6817b0;hpb=d79627719bedb6dc937f3373cebe7de967cd3fad;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/ActionChain.pm b/lib/Catalyst/ActionChain.pm index ceb7c81..6d16104 100644 --- a/lib/Catalyst/ActionChain.pm +++ b/lib/Catalyst/ActionChain.pm @@ -49,14 +49,17 @@ actions in order. sub dispatch { my ( $self, $c ) = @_; my @captures = @{$c->req->captures||[]}; - foreach my $action ( @{ $self->chain } ) { + my @chain = @{ $self->chain }; + my $last = pop(@chain); + foreach my $action ( @chain ) { my @args; - if (my $cap = $action->attributes->{Captures}) { + if (my $cap = $action->attributes->{CaptureArgs}) { @args = splice(@captures, 0, $cap->[0]); } local $c->request->{arguments} = \@args; $action->dispatch( $c ); } + $last->dispatch( $c ); } =head2 from_chain( \@actions )