1#!/usr/bin/perl
2# Root.pm
3# Copyright (c) 2006 Jonathan Rockway <jrockway@cpan.org>
4
5package TestApp::Controller::Root;
6use base 'Catalyst::Controller';
7use Data::Dumper;
8
9__PACKAGE__->config->{namespace} = '';
10
11sub default : Private {
12    my ($self, $c) = @_;
13    $c->res->body(Dumper($c->config));
14}
15
16sub 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
29sub model : Local {
30    my ( $self, $c, $varname ) = @_;
31    $c->res->body(Dumper(\%{$c->model('TestModel')}));
32}
33
34
351;
36