1 package [% rootname %];
3 use namespace::autoclean;
5 BEGIN { extends 'Catalyst::Controller' }
8 # Sets the actions in this controller to be registered with no prefix
9 # so they function identically to actions created in MyApp.pm
11 __PACKAGE__->config(namespace => '');
15 [% rootname %] - Root Controller for [% name %]
19 [enter your description here]
25 The root of the chain, common app-wide functionality generally goes here.
29 sub base :Chained('/') PathPart('') CaptureArgs(0) {
30 # Intentionally blank but you might want to do something here.
35 The root page (/) of the site.
39 sub index :Chained('/base') PathPart('') Args(0) {
40 my ( $self, $c ) = @_;
43 $c->response->body( $c->welcome_message );
48 The default (catch-all) action. Detaches control to the C<not_found>
49 action to generate a 404 page.
53 sub default : Chained('/base') PathPart('') Args {
54 my ( $self, $c ) = @_;
55 $c->detach('not_found');
60 Simple 404 error page.
64 sub not_found : Action {
65 my ( $self, $c ) = @_;
66 $c->response->body( 'Page not found' );
67 $c->response->status(404);
72 Attempt to render a view, if needed.
76 sub end : ActionClass('RenderView') {}
84 This library is free software. You can redistribute it and/or modify
85 it under the same terms as Perl itself.
89 __PACKAGE__->meta->make_immutable;