1 package ESITest::Controller::Root;
5 use parent 'Catalyst::Controller';
7 __PACKAGE__->config->{namespace} = '';
9 sub index :Path Args(0) {
10 my ( $self, $c ) = @_;
13 sub base : Chained('/') PathPart('') CaptureArgs(0) {
14 my ( $self, $c ) = @_;
17 sub time_include : Chained('base') PathPart('time') Args(0) {
18 my ( $self, $c ) = @_;
19 my $params = $c->req->params;
21 $c->stash->{current_time} = localtime();
24 for my $key (keys %$params) {
25 $additional .= "| $key = $params->{$key} | "
28 $c->stash->{additional} = $additional;
32 sub capture : Chained('base') PathPart('') CaptureArgs(1) {
33 my ( $self, $c, $arg ) = @_;
34 $c->log->debug("Capture: $arg");
35 $c->stash->{additional} = "Capture Arg: $arg";
38 sub time_args : Chained('capture') PathPart('time') Args(0) {
39 my ( $self, $c ) = @_;
40 my $params = $c->req->params;
42 $c->stash->{current_time} = localtime();
44 my $additional = $c->stash->{additional};
45 for my $key (keys %$params) {
46 $additional .= "| $key = $params->{$key} | "
49 $c->stash->{additional} = $additional;
51 $c->stash->{template} = 'time_include.tt';
54 sub time_args_with_args : Chained('capture') PathPart('time') Args(1) {
55 my ( $self, $c, $arg ) = @_;
56 my $params = $c->req->params;
58 $c->stash->{current_time} = localtime();
60 my $additional = $c->stash->{additional};
61 for my $key (keys %$params) {
62 $additional .= " | $key = $params->{$key} | "
65 $additional .= " Action Arg: $arg ";
67 $c->stash->{additional} = $additional;
69 $c->stash->{template} = 'time_include.tt';
72 sub time_args_without_capture : Chained('base') PathPart('time') Args(1) {
73 my ( $self, $c, $arg ) = @_;
74 my $params = $c->req->params;
76 $c->stash->{current_time} = localtime();
79 for my $key (keys %$params) {
80 $additional .= " | $key = $params->{$key} | "
83 $additional .= " Action Arg: $arg ";
85 $c->stash->{additional} = $additional;
87 $c->stash->{template} = 'time_include.tt';
90 sub end : ActionClass('RenderView') {}