update distar url
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Action / Chained / ArgsOrder.pm
1 package TestApp::Controller::Action::Chained::ArgsOrder;
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
14 sub base  :Chained('/') PathPart('argsorder') CaptureArgs(0) {
15     my ( $self, $c, $arg ) = @_;
16     push @{ $c->stash->{ passed_args } }, 'base', $arg;
17 }
18
19 sub index :Chained('base') PathPart('') Args(0) {
20     my ( $self, $c, $arg ) = @_;
21     push @{ $c->stash->{ passed_args } }, 'index', $arg;
22 }
23
24 sub all  :Chained('base') PathPart('') Args() {
25     my ( $self, $c, $arg ) = @_;
26     push @{ $c->stash->{ passed_args } }, 'all', $arg;
27 }
28
29 sub end : Private {
30     my ( $self, $c ) = @_;
31     no warnings 'uninitialized';
32     $c->response->body( join '; ', @{ $c->stash->{ passed_args } } );
33 }
34
35 1;