probably sorted capture passing to non-leaf actions
Matt S Trout [Thu, 22 Jun 2006 14:51:31 +0000 (14:51 +0000)]
r10055@cain (orig r4392):  matthewt | 2006-06-17 16:01:24 +0000

lib/Catalyst/ActionChain.pm

index 2bcc31f..ceb7c81 100644 (file)
@@ -48,7 +48,13 @@ actions in order.
 
 sub dispatch {
     my ( $self, $c ) = @_;
+    my @captures = @{$c->req->captures||[]};
     foreach my $action ( @{ $self->chain } ) {
+        my @args;
+        if (my $cap = $action->attributes->{Captures}) {
+          @args = splice(@captures, 0, $cap->[0]);
+        }
+        local $c->request->{arguments} = \@args;
         $action->dispatch( $c );
     }
 }