Commit | Line | Data |
bcccee4e |
1 | package Catalyst::DispatchType::Index; |
2 | |
3 | use strict; |
4 | use base qw/Catalyst::DispatchType/; |
5 | |
6 | =head1 NAME |
7 | |
8 | Catalyst::DispatchType::Index - Index DispatchType |
9 | |
10 | =head1 SYNOPSIS |
11 | |
12 | See L<Catalyst>. |
13 | |
14 | =head1 DESCRIPTION |
15 | |
16 | =head1 METHODS |
17 | |
b5ecfcf0 |
18 | =head2 $self->match( $c, $path ) |
bcccee4e |
19 | |
20 | =cut |
21 | |
22 | sub match { |
23 | my ( $self, $c, $path ) = @_; |
bcccee4e |
24 | return if @{ $c->req->args }; |
a9dc674c |
25 | my $result = $c->get_action( 'index', $path ); |
bcccee4e |
26 | |
bcccee4e |
27 | if ($result) { |
b5ecfcf0 |
28 | $c->action($result); |
a9dc674c |
29 | $c->namespace( $result->namespace ); |
bcccee4e |
30 | $c->req->action('index'); |
31 | $c->req->match( $c->req->path ); |
32 | return 1; |
33 | } |
34 | return 0; |
35 | } |
36 | |
bcccee4e |
37 | =head1 AUTHOR |
38 | |
39 | Sebastian Riedel, C<sri@cpan.org> |
40 | |
41 | =head1 COPYRIGHT |
42 | |
43 | This program is free software, you can redistribute it and/or modify it under |
44 | the same terms as Perl itself. |
45 | |
46 | =cut |
47 | |
48 | 1; |