X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FDispatchType%2FIndex.pm;h=f8768506377b379bd7bb6164a79e1c25e6765d3e;hp=e0203e6ab194c9b1f1c93c815fc282ed228ae6c4;hb=4082e67814e85bc9820e56eb38e5e21511c0a5f8;hpb=772ab8ae1affcaed555bfdb070e18ed1af592b71 diff --git a/lib/Catalyst/DispatchType/Index.pm b/lib/Catalyst/DispatchType/Index.pm index e0203e6..f876850 100644 --- a/lib/Catalyst/DispatchType/Index.pm +++ b/lib/Catalyst/DispatchType/Index.pm @@ -15,21 +15,18 @@ See L. =head1 METHODS -=over 4 - -=item $self->match( $c, $path ) +=head2 $self->match( $c, $path ) =cut sub match { my ( $self, $c, $path ) = @_; return if @{ $c->req->args }; - my $result = @{ $c->get_action( 'index', $path ) || [] }[-1]; + my $result = $c->get_action( 'index', $path ); - # Find default on namespace or super - if ($result) { - $c->action( $result->[0] ); - $c->namespace( $c->req->path ); + if ($result && $result->match($c)) { + $c->action($result); + $c->namespace( $result->namespace ); $c->req->action('index'); $c->req->match( $c->req->path ); return 1; @@ -37,8 +34,6 @@ sub match { return 0; } -=back - =head1 AUTHOR Sebastian Riedel, C