refactor component injection
[catagits/Catalyst-Runtime.git] / lib / Catalyst / DispatchType / Chained.pm
index 6705833..b74c29d 100644 (file)
@@ -247,6 +247,8 @@ sub recurse_match {
         }
         my @try_actions = @{$children->{$try_part}};
         TRY_ACTION: foreach my $action (@try_actions) {
+
+
             if (my $capture_attr = $action->attributes->{CaptureArgs}) {
                 my $capture_count = $action->number_of_captures|| 0;
 
@@ -298,7 +300,6 @@ sub recurse_match {
                 # OR No parts and this expects 0
                 #    The current best action might also be Args(0),
                 #    but we couldn't chose between then anyway so we'll take the last seen
-
                 if (
                     !$best_action                       ||
                     @parts < @{$best_action->{parts}}   ||
@@ -728,6 +729,10 @@ custom type constraints and import them into the controller namespace:
 
       sub int_priority_chain :Chained(chain_base) PathPart('') Args(Int) { }
 
+If you use a reference type constraint in CaptureArgs, it must be a type
+like Tuple in L<Types::Standard> that allows us to determine the number of
+args to match.  Otherwise this will raise an error during startup.
+
 See L<Catalyst::RouteMatching> for more.
 
 =item Args
@@ -748,6 +753,9 @@ Just as with C<:CaptureArgs>, the arguments get passed to the action in
 C<@_> after the context object. They can also be reached through
 C<$c-E<gt>request-E<gt>arguments>.
 
+You should see 'Args' in L<Catalyst::Controller> for more details on using
+type constraints in your Args declarations.
+
 =back
 
 =head2 Auto actions, dispatching and forwarding