initial commit
[catagits/Catalyst-Plugin-ConfigLoader-Environment.git] / t / lib / TestApp / Controller / Root.pm
1 #!/usr/bin/perl
2 # Root.pm 
3 # Copyright (c) 2006 Jonathan Rockway <jrockway@cpan.org>
4
5 package TestApp::Controller::Root;
6 use base 'Catalyst::Controller';
7 use Data::Dumper;
8
9 __PACKAGE__->config->{namespace} = '';
10
11 sub default : Private {
12     my ($self, $c) = @_;
13     $c->res->body(Dumper($c->config));
14 }
15
16 sub foo : Local {
17     my ($self, $c, $varname) = @_;
18     my $result = $c->view('TestView')->$varname;
19     if (ref $result) {
20         local($Data::Dumper::Purity) = 1;
21         local($Data::Dumper::Indent) = 0;
22         local($Data::Dumper::Varname) = $varname;
23         $result = Dumper($c->view('TestView')->quux);
24         $result =~ s{1}{};
25     }
26     $c->res->body($result);
27 }
28
29 sub model : Local {
30     my ( $self, $c, $varname ) = @_;
31     $c->res->body(Dumper(\%{$c->model('TestModel')}));
32 }
33
34   
35 1;