Commit | Line | Data |
30726632 |
1 | package ESITest::Controller::Root; |
2 | |
3 | use strict; |
4 | use warnings; |
9e1146e4 |
5 | use base 'Catalyst::Controller'; |
30726632 |
6 | |
7 | __PACKAGE__->config->{namespace} = ''; |
8 | |
7b1b8afd |
9 | sub index :Path Args(0) {} |
10 | |
11 | sub base : Chained('/') PathPart('') CaptureArgs(0) {} |
e88af283 |
12 | |
13 | sub time_include : Chained('base') PathPart('time') Args(0) { |
30726632 |
14 | my ( $self, $c ) = @_; |
3c5cb6d6 |
15 | my $params = $c->req->params; |
16 | |
17 | $c->stash->{current_time} = localtime(); |
18 | |
19 | my $additional = ''; |
20 | for my $key (keys %$params) { |
21 | $additional .= "| $key = $params->{$key} | " |
22 | } |
23 | |
24 | $c->stash->{additional} = $additional; |
25 | |
26 | } |
27 | |
28 | sub capture : Chained('base') PathPart('') CaptureArgs(1) { |
29 | my ( $self, $c, $arg ) = @_; |
c33bb236 |
30 | $c->log->debug("Capture: $arg") if $c->debug; |
9c2c47b0 |
31 | $c->stash->{additional} = "Capture Arg: $arg"; |
3c5cb6d6 |
32 | } |
33 | |
34 | sub time_args : Chained('capture') PathPart('time') Args(0) { |
35 | my ( $self, $c ) = @_; |
36 | my $params = $c->req->params; |
37 | |
30726632 |
38 | $c->stash->{current_time} = localtime(); |
3c5cb6d6 |
39 | |
40 | my $additional = $c->stash->{additional}; |
41 | for my $key (keys %$params) { |
42 | $additional .= "| $key = $params->{$key} | " |
43 | } |
44 | |
45 | $c->stash->{additional} = $additional; |
46 | |
47 | $c->stash->{template} = 'time_include.tt'; |
30726632 |
48 | } |
49 | |
9c2c47b0 |
50 | sub time_args_with_args : Chained('capture') PathPart('time') Args(1) { |
51 | my ( $self, $c, $arg ) = @_; |
52 | my $params = $c->req->params; |
53 | |
54 | $c->stash->{current_time} = localtime(); |
55 | |
56 | my $additional = $c->stash->{additional}; |
57 | for my $key (keys %$params) { |
58 | $additional .= " | $key = $params->{$key} | " |
59 | } |
60 | |
61 | $additional .= " Action Arg: $arg "; |
62 | |
63 | $c->stash->{additional} = $additional; |
64 | |
65 | $c->stash->{template} = 'time_include.tt'; |
66 | } |
67 | |
68 | sub time_args_without_capture : Chained('base') PathPart('time') Args(1) { |
69 | my ( $self, $c, $arg ) = @_; |
70 | my $params = $c->req->params; |
71 | |
72 | $c->stash->{current_time} = localtime(); |
73 | |
74 | my $additional = ''; |
75 | for my $key (keys %$params) { |
76 | $additional .= " | $key = $params->{$key} | " |
77 | } |
78 | |
79 | $additional .= " Action Arg: $arg "; |
80 | |
81 | $c->stash->{additional} = $additional; |
82 | |
83 | $c->stash->{template} = 'time_include.tt'; |
84 | } |
85 | |
f61393b7 |
86 | sub time_args_no_chained : Path('time_args_no_chained') Args { |
87 | my ($self, $c, @args) = @_; |
88 | |
89 | my $params = $c->req->params; |
90 | |
91 | $c->stash->{current_time} = localtime(); |
92 | |
93 | my $additional = ''; |
94 | for my $key (keys %$params) { |
95 | $additional .= " | $key = $params->{$key} | " |
96 | } |
97 | |
98 | $additional .= " No Chained Args: " . join ', ', @args; |
99 | |
100 | $c->stash->{additional} = $additional; |
101 | |
102 | $c->stash->{template} = 'time_include.tt'; |
103 | } |
104 | |
48509210 |
105 | sub http_cpan : Chained('base') Args(0) {} |
7b1b8afd |
106 | |
48509210 |
107 | sub http_github : Chained('base') Args(0) {} |
7b1b8afd |
108 | |
30726632 |
109 | sub end : ActionClass('RenderView') {} |
110 | |
111 | 1; |