1 package TestApp::Controller::Action::Chained::CaptureArgs;
5 use base qw( Catalyst::Controller );
8 # This controller builds two patterns of URI:
10 # /captureargs/*/*/edit
13 # It will output the arguments they got passed to @_ after the
15 # /captureargs/one/edit should not dispatch to
18 sub base :Chained('/') PathPart('captureargs') CaptureArgs(0) {
19 my ( $self, $c, $arg ) = @_;
20 push @{ $c->stash->{ passed_args } }, 'base';
23 sub two_args :Chained('base') PathPart('') CaptureArgs(2) {
24 my ( $self, $c, $arg1, $arg2 ) = @_;
25 push @{ $c->stash->{ passed_args } }, 'two_args', $arg1, $arg2;
28 sub one_arg :Chained('base') ParthPart('') CaptureArgs(1) {
29 my ( $self, $c, $arg ) = @_;
30 push @{ $c->stash->{ passed_args } }, 'one_arg', $arg;
33 sub edit_two_args :Chained('two_args') PathPart('edit') Args(0) {
34 my ( $self, $c ) = @_;
35 push @{ $c->stash->{ passed_args } }, 'edit_two_args';
38 sub edit_one_arg :Chained('one_arg') PathPart('edit') Args(0) {
39 my ( $self, $c ) = @_;
40 push @{ $c->stash->{ passed_args } }, 'edit_one_arg';
43 sub view_two_args :Chained('two_args') PathPart('') Args(0) {
44 my ( $self, $c ) = @_;
45 push @{ $c->stash->{ passed_args } }, 'view_two_args';
48 sub view_one_arg :Chained('one_arg') PathPart('') Args(0) {
49 my ( $self, $c ) = @_;
50 push @{ $c->stash->{ passed_args } }, 'view_one_arg';
55 my ( $self, $c ) = @_;
56 no warnings 'uninitialized';
57 $c->response->body( join '; ', @{ $c->stash->{ passed_args } } );