1 package Catalyst::DispatchType::Default;
4 use base qw/Catalyst::DispatchType/;
8 Catalyst::DispatchType::Default - Default DispatchType
18 =head2 $self->match( $c, $path )
20 Check if default action matches, and set action if it does.
21 Will be called last for each controller.
26 my ( $self, $c, $path ) = @_;
27 return if $path =~ m!/!; # Not at root yet, wait for it ...
28 my $result = ( $c->get_actions( 'default', $c->req->path ) )[-1];
30 # Find default on namespace or super
31 if ($result && $result->match($c)) {
33 $c->namespace( $result->namespace );
34 $c->req->action('default');
36 # default methods receive the controller name as the first argument
37 unshift @{ $c->req->args }, $path if $path;
47 Sebastian Riedel, C<sri@cpan.org>
51 This program is free software, you can redistribute it and/or modify it under
52 the same terms as Perl itself.