Commit | Line | Data |
32d5a0c5 |
1 | package TestApp::Controller::Root; |
5ab21903 |
2 | use strict; |
3 | use warnings; |
32d5a0c5 |
4 | use base 'Catalyst::Controller'; |
5 | |
6 | __PACKAGE__->config->{namespace} = ''; |
7 | |
81e75875 |
8 | sub chain_root_index : Chained('/') PathPart('') Args(0) { } |
9 | |
53119b78 |
10 | sub zero : Path('0') { |
11 | my ( $self, $c ) = @_; |
12 | $c->res->header( 'X-Test-Class' => ref($self) ); |
13 | $c->response->content_type('text/plain; charset=utf-8'); |
14 | $c->forward('TestApp::View::Dump::Request'); |
15 | } |
16 | |
19c01ee1 |
17 | sub localregex : LocalRegex('^localregex$') { |
18 | my ( $self, $c ) = @_; |
19 | $c->res->header( 'X-Test-Class' => ref($self) ); |
20 | $c->response->content_type('text/plain; charset=utf-8'); |
21 | $c->forward('TestApp::View::Dump::Request'); |
22 | } |
23 | |
a202886b |
24 | sub index : Private { |
25 | my ( $self, $c ) = @_; |
26 | $c->res->body('root index'); |
27 | } |
28 | |
29 | sub global_action : Private { |
30 | my ( $self, $c ) = @_; |
31 | $c->forward('TestApp::View::Dump::Request'); |
32 | } |
33 | |
34 | sub class_forward_test_method :Private { |
35 | my ( $self, $c ) = @_; |
36 | $c->response->headers->header( 'X-Class-Forward-Test-Method' => 1 ); |
37 | } |
38 | |
39 | sub loop_test : Local { |
40 | my ( $self, $c ) = @_; |
41 | |
42 | for( 1..1001 ) { |
43 | $c->forward( 'class_forward_test_method' ); |
44 | } |
45 | } |
46 | |
47 | sub recursion_test : Local { |
48 | my ( $self, $c ) = @_; |
49 | $c->forward( 'recursion_test' ); |
50 | } |
51 | |
a0a66cb8 |
52 | sub end : Private { |
53 | my ($self,$c) = @_; |
54 | } |
55 | |
32d5a0c5 |
56 | 1; |