X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FChainedActionsApp%2FController%2FRoot.pm;h=a4360872feff076a48aa762bd7d46e88c911b170;hb=d4f76f02f299906d23b02bb4bb4007de437a8747;hp=3186f6e61a9fbd5c3b87fa17ef449514f639e13d;hpb=6df93c611f471d8c87c9586cd97009a91529b51d;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/ChainedActionsApp/Controller/Root.pm b/t/lib/ChainedActionsApp/Controller/Root.pm index 3186f6e..a436087 100644 --- a/t/lib/ChainedActionsApp/Controller/Root.pm +++ b/t/lib/ChainedActionsApp/Controller/Root.pm @@ -10,24 +10,6 @@ BEGIN { extends 'Catalyst::Controller' } # __PACKAGE__->config(namespace => ''); -=head1 NAME - -test_chained::Controller::Root - Root Controller for test_chained - -=head1 DESCRIPTION - -[enter your description here] - -=head1 METHODS - -=head2 setup - -This is the C method that initializes the request. Any matching action -will go through this, so it is an application-wide automatically executed -action. For more information, see L - -=cut - sub setup : Chained('/') PathPart('') CaptureArgs(0) { my ( $self, $c ) = @_; # Common things here are to check for ACL and setup global contexts @@ -38,27 +20,19 @@ sub home : Chained('setup') PathPart('') Args(0) { $c->response->body( "Application Home Page" ); } -=head2 home_base - - Args: - project_id - project_title - -=cut - sub home_base : Chained('setup') PathPart('') CaptureArgs(2) { my($self,$c,$proj_id,$title) = @_; - $c->stash->{project_id}=$proj_id; + $c->stash({project_id=>$proj_id, project_title=>$title}); } sub hpages : Chained('home_base') PathPart('') Args(0) { my($self,$c) = @_; - $c->response->body( "List project " . $c->stash->{project_id} . " pages"); + $c->response->body( "List project " . $c->stash->{project_title} . " pages"); } sub hpage : Chained('home_base') PathPart('') Args(2) { my($self,$c,$page_id, $pagetitle) = @_; - $c->response->body( "This is $pagetitle page of " . $c->stash->{project_id} . " project" ); + $c->response->body( "This is $pagetitle page of " . $c->stash->{project_title} . " project" ); } sub no_account : Chained('setup') PathPart('account') Args(0) { @@ -76,11 +50,15 @@ sub account : Chained('account_base') PathPart('') Args(0) { $c->response->body( "This is account " . $c->stash->{account_id} ); } -=head2 default - -Standard 404 error page +sub profile_base : Chained('setup') PathPart('account/profile') CaptureArgs(1) { + my($self,$c,$acc_id) = @_; + $c->stash({account_id=>$acc_id}); +} -=cut +sub profile : Chained('profile_base') PathPart('') Args(1) { + my($self,$c,$acc) = @_; + $c->response->body( "This is profile of " . $acc ); +} sub default : Chained('setup') PathPart('') Args() { my ( $self, $c ) = @_; @@ -88,24 +66,7 @@ sub default : Chained('setup') PathPart('') Args() { $c->response->status(404); } -=head2 end - -Attempt to render a view, if needed. - -=cut - -sub end : ActionClass('RenderView') {} - -=head1 AUTHOR - -Ferruccio Zamuner - -=head1 LICENSE - -This library is free software. You can redistribute it and/or modify -it under the same terms as Perl itself. - -=cut +sub end : Action {} __PACKAGE__->meta->make_immutable;