1 package ESITest::Controller::Root;
5 use base 'Catalyst::Controller';
7 __PACKAGE__->config->{namespace} = '';
9 sub index :Path Args(0) {}
11 sub base : Chained('/') PathPart('') CaptureArgs(0) {}
13 sub time_include : Chained('base') PathPart('time') Args(0) {
14 my ( $self, $c ) = @_;
15 my $params = $c->req->params;
17 $c->stash->{current_time} = localtime();
20 for my $key (keys %$params) {
21 $additional .= "| $key = $params->{$key} | "
24 $c->stash->{additional} = $additional;
28 sub capture : Chained('base') PathPart('') CaptureArgs(1) {
29 my ( $self, $c, $arg ) = @_;
30 $c->log->debug("Capture: $arg") if $c->debug;
31 $c->stash->{additional} = "Capture Arg: $arg";
34 sub time_args : Chained('capture') PathPart('time') Args(0) {
35 my ( $self, $c ) = @_;
36 my $params = $c->req->params;
38 $c->stash->{current_time} = localtime();
40 my $additional = $c->stash->{additional};
41 for my $key (keys %$params) {
42 $additional .= "| $key = $params->{$key} | "
45 $c->stash->{additional} = $additional;
47 $c->stash->{template} = 'time_include.tt';
50 sub time_args_with_args : Chained('capture') PathPart('time') Args(1) {
51 my ( $self, $c, $arg ) = @_;
52 my $params = $c->req->params;
54 $c->stash->{current_time} = localtime();
56 my $additional = $c->stash->{additional};
57 for my $key (keys %$params) {
58 $additional .= " | $key = $params->{$key} | "
61 $additional .= " Action Arg: $arg ";
63 $c->stash->{additional} = $additional;
65 $c->stash->{template} = 'time_include.tt';
68 sub time_args_without_capture : Chained('base') PathPart('time') Args(1) {
69 my ( $self, $c, $arg ) = @_;
70 my $params = $c->req->params;
72 $c->stash->{current_time} = localtime();
75 for my $key (keys %$params) {
76 $additional .= " | $key = $params->{$key} | "
79 $additional .= " Action Arg: $arg ";
81 $c->stash->{additional} = $additional;
83 $c->stash->{template} = 'time_include.tt';
86 sub time_args_no_chained : Path('time_args_no_chained') Args {
87 my ($self, $c, @args) = @_;
89 my $params = $c->req->params;
91 $c->stash->{current_time} = localtime();
94 for my $key (keys %$params) {
95 $additional .= " | $key = $params->{$key} | "
98 $additional .= " No Chained Args: " . join ', ', @args;
100 $c->stash->{additional} = $additional;
102 $c->stash->{template} = 'time_include.tt';
105 sub http_cpan : Chained('base') Args(0) {}
107 sub http_github : Chained('base') Args(0) {}
109 sub end : ActionClass('RenderView') {}