Commit | Line | Data |
5882c86e |
1 | package TestApp::Controller::Action::Chained::PassedArgs; |
b25353e5 |
2 | use warnings; |
3 | use strict; |
4 | |
5 | use 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 | |
1c34f703 |
14 | sub first : PathPart('chained/passedargs/a') Chained('/') CaptureArgs(1) { |
b25353e5 |
15 | my ( $self, $c, $arg ) = @_; |
16 | $c->stash->{ passed_args } = [ $arg ]; |
17 | } |
18 | |
1c34f703 |
19 | sub second : PathPart('b') Chained('first') CaptureArgs(1) { |
b25353e5 |
20 | my ( $self, $c, $arg ) = @_; |
21 | push @{ $c->stash->{ passed_args } }, $arg; |
22 | } |
23 | |
5882c86e |
24 | sub third : PathPart('c') Chained('second') Args(1) { |
b25353e5 |
25 | my ( $self, $c, $arg ) = @_; |
26 | push @{ $c->stash->{ passed_args } }, $arg; |
27 | } |
28 | |
29 | sub end : Private { |
30 | my ( $self, $c ) = @_; |
31 | $c->response->body( join '; ', @{ $c->stash->{ passed_args } } ); |
32 | } |
33 | |
34 | 1; |