From: Tomas Doran Date: Wed, 16 Jun 2010 01:26:34 +0000 (+0100) Subject: Fix up a bit, still needs compclass.tt doing X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fremotes%2Fmirror%2Fskeleton_with_chained;p=catagits%2FCatalyst-Devel.git Fix up a bit, still needs compclass.tt doing --- diff --git a/share/lib/MyApp/Controller/Root.pm.tt b/share/lib/MyApp/Controller/Root.pm.tt index 95a08d4..3f0d578 100644 --- a/share/lib/MyApp/Controller/Root.pm.tt +++ b/share/lib/MyApp/Controller/Root.pm.tt @@ -22,8 +22,7 @@ __PACKAGE__->config(namespace => ''); =head2 base -The root of the chain, offers flexibility to the below actions depending on -whether / has an argument (sub default) or not (sub index). +The root of the chain, common app-wide functionality generally goes here. =cut @@ -46,12 +45,24 @@ sub index :Chained('/base') PathPart('') Args(0) { =head2 default -Standard 404 error page +The default (catch-all) action. Detaches control to the C +action to generate a 404 page. =cut sub default : Chained('/base') PathPart('') Args { my ( $self, $c ) = @_; + $c->detach('not_found'); +} + +=head2 not_found + +Simple 404 error page. + +=cut + +sub not_found : Action { + my ( $self, $c ) = @_; $c->response->body( 'Page not found' ); $c->response->status(404); }