Commit | Line | Data |
239b5fc0 |
1 | package [% rootname %]; |
8662edf6 |
2 | use Moose; |
3 | use namespace::autoclean; |
239b5fc0 |
4 | |
8662edf6 |
5 | BEGIN { extends 'Catalyst::Controller' } |
239b5fc0 |
6 | |
7 | # |
8 | # Sets the actions in this controller to be registered with no prefix |
9 | # so they function identically to actions created in MyApp.pm |
10 | # |
3e5f7783 |
11 | __PACKAGE__->config(namespace => ''); |
239b5fc0 |
12 | |
b108baa7 |
13 | =encoding utf-8 |
14 | |
239b5fc0 |
15 | =head1 NAME |
16 | |
17 | [% rootname %] - Root Controller for [% name %] |
18 | |
19 | =head1 DESCRIPTION |
20 | |
21 | [enter your description here] |
22 | |
23 | =head1 METHODS |
24 | |
239b5fc0 |
25 | =head2 index |
26 | |
3d3e34a0 |
27 | The root page (/) |
28 | |
239b5fc0 |
29 | =cut |
30 | |
31 | sub index :Path :Args(0) { |
32 | my ( $self, $c ) = @_; |
33 | |
34 | # Hello World |
35 | $c->response->body( $c->welcome_message ); |
36 | } |
37 | |
3d3e34a0 |
38 | =head2 default |
39 | |
40 | Standard 404 error page |
41 | |
42 | =cut |
43 | |
239b5fc0 |
44 | sub default :Path { |
45 | my ( $self, $c ) = @_; |
46 | $c->response->body( 'Page not found' ); |
47 | $c->response->status(404); |
48 | } |
49 | |
50 | =head2 end |
51 | |
52 | Attempt to render a view, if needed. |
53 | |
54 | =cut |
55 | |
56 | sub end : ActionClass('RenderView') {} |
57 | |
58 | =head1 AUTHOR |
59 | |
60 | [% author %] |
61 | |
62 | =head1 LICENSE |
63 | |
64 | This library is free software. You can redistribute it and/or modify |
65 | it under the same terms as Perl itself. |
66 | |
67 | =cut |
68 | |
8662edf6 |
69 | __PACKAGE__->meta->make_immutable; |
7e6d9ba3 |
70 | |
71 | 1; |