Commit | Line | Data |
30726632 |
1 | package ESITest::Controller::Root; |
2 | |
3 | use strict; |
4 | use warnings; |
5 | use parent 'Catalyst::Controller'; |
6 | |
7 | __PACKAGE__->config->{namespace} = ''; |
8 | |
e88af283 |
9 | sub index :Path Args(0) { |
30726632 |
10 | my ( $self, $c ) = @_; |
11 | } |
12 | |
e88af283 |
13 | sub base : Chained('/') PathPart('') CaptureArgs(0) { |
14 | my ( $self, $c ) = @_; |
15 | } |
16 | |
17 | sub time_include : Chained('base') PathPart('time') Args(0) { |
30726632 |
18 | my ( $self, $c ) = @_; |
3c5cb6d6 |
19 | my $params = $c->req->params; |
20 | |
21 | $c->stash->{current_time} = localtime(); |
22 | |
23 | my $additional = ''; |
24 | for my $key (keys %$params) { |
25 | $additional .= "| $key = $params->{$key} | " |
26 | } |
27 | |
28 | $c->stash->{additional} = $additional; |
29 | |
30 | } |
31 | |
32 | sub capture : Chained('base') PathPart('') CaptureArgs(1) { |
33 | my ( $self, $c, $arg ) = @_; |
34 | $c->log->debug("Capture: $arg"); |
35 | $c->stash->{additional} = "Arg: $arg"; |
36 | } |
37 | |
38 | sub time_args : Chained('capture') PathPart('time') Args(0) { |
39 | my ( $self, $c ) = @_; |
40 | my $params = $c->req->params; |
41 | |
30726632 |
42 | $c->stash->{current_time} = localtime(); |
3c5cb6d6 |
43 | |
44 | my $additional = $c->stash->{additional}; |
45 | for my $key (keys %$params) { |
46 | $additional .= "| $key = $params->{$key} | " |
47 | } |
48 | |
49 | $c->stash->{additional} = $additional; |
50 | |
51 | $c->stash->{template} = 'time_include.tt'; |
30726632 |
52 | } |
53 | |
54 | sub end : ActionClass('RenderView') {} |
55 | |
56 | 1; |