Commit | Line | Data |
5882c86e |
1 | package TestApp::Controller::Action::Chained::Foo; |
141459fa |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use base qw/Catalyst::Controller/; |
7 | |
d416846e |
8 | # |
9 | # Child of current namespace |
10 | # |
1dc8af44 |
11 | sub spoon :Chained('.') :Args(0) { } |
141459fa |
12 | |
d416846e |
13 | # |
14 | # Root for a action in a "parent" controller |
15 | # |
1c34f703 |
16 | sub higher_root :PathPart('chained/higher_root') :Chained('/') :CaptureArgs(1) { } |
d416846e |
17 | |
18 | # |
19 | # Parent controller -> this subcontroller -> parent controller test |
20 | # |
1c34f703 |
21 | sub pcp2 :Chained('/action/chained/pcp1') :CaptureArgs(1) { } |
d416846e |
22 | |
23 | # |
24 | # Controllers not in parent/child relation. This tests the end. |
25 | # |
5882c86e |
26 | sub cross2 :PathPart('end') :Chained('/action/chained/bar/cross1') :Args(1) { } |
d416846e |
27 | |
81e75875 |
28 | # |
29 | # Create a uri to the root index |
30 | # |
31 | sub to_root : Chained('/') PathPart('action/chained/to_root') { |
32 | my ( $self, $c ) = @_; |
33 | my $uri = $c->uri_for( |
34 | $c->controller('Root')->action_for('chain_root_index') ); |
35 | $c->res->body( "URI:$uri" ); |
36 | $c->stash->{no_end}++; |
37 | } |
38 | |
141459fa |
39 | 1; |