Commit | Line | Data |
e37ad815 |
1 | package TestApp;\r |
2 | \r |
3 | use strict;\r |
4 | use Catalyst;\r |
5 | \r |
6 | our $VERSION = '0.01';\r |
7 | \r |
8 | TestApp->config(\r |
9 | name => 'TestApp',\r |
10 | );\r |
11 | \r |
8cc672a2 |
12 | my @plugins = qw/Static::Simple/;\r |
82239955 |
13 | \r |
14 | # load the SubRequest plugin if available\r |
d62f3c98 |
15 | eval { \r |
16 | require Catalyst::Plugin::SubRequest; \r |
17 | die unless Catalyst::Plugin::SubRequest->VERSION ge '0.08';\r |
18 | };\r |
82239955 |
19 | push @plugins, 'SubRequest' unless ($@);\r |
20 | \r |
21 | TestApp->setup( @plugins );\r |
e37ad815 |
22 | \r |
23 | sub incpath_generator {\r |
24 | my $c = shift;\r |
25 | \r |
26 | return [ $c->config->{root} . '/incpath' ];\r |
27 | }\r |
28 | \r |
29 | sub default : Private {\r |
30 | my ( $self, $c ) = @_;\r |
31 | \r |
32 | $c->res->output( 'default' );\r |
33 | }\r |
34 | \r |
82239955 |
35 | sub subtest : Local {\r |
36 | my ( $self, $c ) = @_;\r |
37 | \r |
38 | $c->res->output( $c->subreq('/subtest2') );\r |
39 | }\r |
40 | \r |
41 | sub subtest2 : Local {\r |
42 | my ( $self, $c ) = @_;\r |
43 | \r |
44 | $c->res->output( 'subtest2 ok' );\r |
45 | }\r |
46 | \r |
e37ad815 |
47 | 1;\r |