Captures required, Args not
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Action / ChildOf / PassedArgs.pm
CommitLineData
b25353e5 1package TestApp::Controller::Action::ChildOf::PassedArgs;
2use warnings;
3use strict;
4
5use base qw( Catalyst::Controller );
6
7#
8# This controller builds a simple chain of three actions that
9# will output the arguments they got passed to @_ after the
10# context object. We do this to test if that passing works
11# as it should.
12#
13
14sub first : PathPart('childof/passedargs/a') ChildOf('/') Captures(1) {
15 my ( $self, $c, $arg ) = @_;
16 $c->stash->{ passed_args } = [ $arg ];
17}
18
19sub second : PathPart('b') ChildOf('first') Captures(1) {
20 my ( $self, $c, $arg ) = @_;
21 push @{ $c->stash->{ passed_args } }, $arg;
22}
23
24sub third : PathPart('c') ChildOf('second') Args(1) {
25 my ( $self, $c, $arg ) = @_;
26 push @{ $c->stash->{ passed_args } }, $arg;
27}
28
29sub end : Private {
30 my ( $self, $c ) = @_;
31 $c->response->body( join '; ', @{ $c->stash->{ passed_args } } );
32}
33
341;