Changeset 9859
- Timestamp:
- 04/19/08 10:33:14 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Jipotter/branches/Cipotter/lib/Cipotter/Controller/Root.pm
r9853 r9859 3 3 use strict; 4 4 use warnings; 5 use parent 'Catalyst::Controller';5 use parent qw( Catalyst::Controller ); 6 6 7 #8 # Sets the actions in this controller to be registered with no prefix9 # so they function identically to actions created in MyApp.pm10 #11 7 __PACKAGE__->config->{namespace} = ''; 12 8 13 =head1 NAME 9 # XXX: What's the best way to make this configurable? 14 10 15 Cipotter::Controller::Root - Root Controller for Cipotter 11 sub base_path : Chained('/') PathPart('cipotter') CaptureArgs(0) { 12 my ($self, $c) = @_; 16 13 17 =head1 DESCRIPTION 18 19 [enter your description here] 20 21 =head1 METHODS 22 23 =cut 24 25 =head2 default 26 27 =cut 28 29 sub index : Path Args(0) { 30 my ( $self, $c ) = @_; 31 32 # Hello World 33 $c->response->body( $c->welcome_message ); 14 $c->stash->{base_path} = '/cipotter'; 34 15 } 35 16 36 17 sub default : Path { 37 my ( $self, $c ) = @_; 38 $c->response->body( 'Page not found' ); 39 $c->response->status(404); 40 18 my ($self, $c) = @_; 19 20 $c->detach('/not_found'); 41 21 } 42 22 43 =head2 end 23 sub not_found : Path { 24 my ($self, $c) = @_; 44 25 45 Attempt to render a view, if needed. 46 47 =cut 26 $c->response->status(404); 27 $c->stash->{current_view} = 'ERROR'; 28 } 48 29 49 30 sub end : ActionClass('RenderView') {} 50 31 51 =head1 AUTHOR52 53 Catalyst developer54 55 =head1 LICENSE56 57 This library is free software, you can redistribute it and/or modify58 it under the same terms as Perl itself.59 60 =cut61 62 32 1;
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)