Updated catalyst.pl
[catagits/Catalyst-Runtime.git] / lib / Catalyst / DispatchType / Index.pm
CommitLineData
bcccee4e 1package Catalyst::DispatchType::Index;
2
3use strict;
4use base qw/Catalyst::DispatchType/;
5
6=head1 NAME
7
8Catalyst::DispatchType::Index - Index 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 {
25 my ( $self, $c, $path ) = @_;
bcccee4e 26 return if @{ $c->req->args };
a9dc674c 27 my $result = $c->get_action( 'index', $path );
bcccee4e 28
bcccee4e 29 if ($result) {
a9dc674c 30 $c->action( $result );
31 $c->namespace( $result->namespace );
bcccee4e 32 $c->req->action('index');
33 $c->req->match( $c->req->path );
34 return 1;
35 }
36 return 0;
37}
38
39=back
40
41=head1 AUTHOR
42
43Sebastian Riedel, C<sri@cpan.org>
44
45=head1 COPYRIGHT
46
47This program is free software, you can redistribute it and/or modify it under
48the same terms as Perl itself.
49
50=cut
51
521;