X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FDispatchType%2FChained.pm;h=585bf3f3e6e3ba0b96def04f02088f4b277d1206;hp=95d6559836b9c67696c6ed60ec7aab96072fcb40;hb=59d5a63860b7506d4f5542c2774163cad745a27a;hpb=13c6b4cc50b9235536022e4deb470c151d9b7fac diff --git a/lib/Catalyst/DispatchType/Chained.pm b/lib/Catalyst/DispatchType/Chained.pm index 95d6559..585bf3f 100644 --- a/lib/Catalyst/DispatchType/Chained.pm +++ b/lib/Catalyst/DispatchType/Chained.pm @@ -39,6 +39,8 @@ Catalyst::DispatchType::Chained - Path Part DispatchType =head1 SYNOPSIS +Path part matching, allowing several actions to sequentially take care of processing a request: + # root action - captures one argument after it sub foo_setup : Chained('/') PathPart('foo') CaptureArgs(1) { my ( $self, $c, $foo_arg ) = @_; @@ -53,7 +55,16 @@ Catalyst::DispatchType::Chained - Path Part DispatchType =head1 DESCRIPTION -See L. +Dispatch type managing default behaviour. For more information on +dispatch types, see: + +=over 4 + +=item * L for how they affect application authors + +=item * L for implementation information. + +=back =head1 METHODS @@ -75,7 +86,7 @@ sub list { my $has_unattached_actions; my $unattached_actions = Text::SimpleTable->new( - [ 35, 'Private' ], [ 36, 'Missing parent' ], + [ 35, 'Private' ], [ $column_width, 'Missing parent' ], ); ENDPOINT: foreach my $endpoint ( @@ -101,7 +112,7 @@ sub list { } if ($parent ne '/') { $has_unattached_actions = 1; - $unattached_actions->row('/'.$parents[0]->reverse, $parent); + $unattached_actions->row('/' . ($parents[0] || $endpoint)->reverse, $parent); next ENDPOINT; } my @rows; @@ -334,7 +345,7 @@ sub uri_for_action { return undef if @captures; # fail for too many captures return join('/', '', @parts); - + } =head2 $c->expand_action($action)