Fixed typo in myapp_fastcgi.pl helper
[catagits/Catalyst-Runtime.git] / lib / Catalyst / DispatchType / Default.pm
CommitLineData
b96f127f 1package Catalyst::DispatchType::Default;
2
3use strict;
4use base qw/Catalyst::DispatchType/;
5
2633d7dc 6=head1 NAME
7
8Catalyst::DispatchType::Default - Default DispatchType
9
10=head1 SYNOPSIS
11
12See L<Catalyst>.
13
14=head1 DESCRIPTION
15
16=head1 METHODS
17
18=over 4
19
20=item $self->match( $c, $path )
21
22=cut
23
24sub match {
78d760bb 25 my ( $self, $c, $path ) = @_;
26 return if $path =~ m!/!; # Not at root yet, wait for it ...
27 my $result = @{ $c->get_action( 'default', $c->req->path, 1 ) || [] }[-1];
28
29 # Find default on namespace or super
b96f127f 30 if ($result) {
31 $c->action( $result->[0] );
32 $c->namespace( $c->req->path );
33 $c->req->action('default');
7cfcfd27 34 # default methods receive the controller name as the first argument
74dafab7 35 unshift @{ $c->req->args }, $path;
b96f127f 36 $c->req->match('');
22f3a8dd 37 return 1;
b96f127f 38 }
22f3a8dd 39 return 0;
b96f127f 40}
41
2633d7dc 42=back
43
44=head1 AUTHOR
45
46Matt S Trout
47Sebastian Riedel, C<sri@cpan.org>
48
49=head1 COPYRIGHT
50
51This program is free software, you can redistribute it and/or modify it under
52the same terms as Perl itself.
53
54=cut
55
b96f127f 561;