new test case
[catagits/Catalyst-View-Component-SubInclude.git] / t / ESITest / lib / ESITest / Controller / Root.pm
CommitLineData
30726632 1package ESITest::Controller::Root;
2
3use strict;
4use warnings;
5use parent 'Catalyst::Controller';
6
7__PACKAGE__->config->{namespace} = '';
8
e88af283 9sub index :Path Args(0) {
30726632 10 my ( $self, $c ) = @_;
11}
12
e88af283 13sub base : Chained('/') PathPart('') CaptureArgs(0) {
14 my ( $self, $c ) = @_;
15}
16
17sub 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
32sub 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
38sub 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
54sub end : ActionClass('RenderView') {}
55
561;