Fix plugin links in POD
[catagits/Catalyst-View-Component-SubInclude.git] / t / lib / ESITest / Controller / Root.pm
1 package ESITest::Controller::Root;
2
3 use strict;
4 use warnings;
5 use base 'Catalyst::Controller';
6
7 __PACKAGE__->config->{namespace} = '';
8
9 sub index :Path Args(0) {}
10
11 sub base : Chained('/') PathPart('') CaptureArgs(0) {}
12
13 sub time_include : Chained('base') PathPart('time') Args(0) {
14     my ( $self, $c ) = @_;
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 ) = @_;
30     $c->log->debug("Capture: $arg") if $c->debug;
31     $c->stash->{additional} = "Capture Arg: $arg";
32 }
33
34 sub time_args : Chained('capture') PathPart('time') Args(0) {
35     my ( $self, $c ) = @_;
36     my $params = $c->req->params;
37
38     $c->stash->{current_time} = localtime();
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';
48 }
49
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
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
105 sub http_cpan : Chained('base') Args(0) {}
106
107 sub http_github : Chained('base') Args(0) {}
108
109 sub end : ActionClass('RenderView') {}
110
111 1;