1 # Copyright (c) 2007 Jonathan Rockway <jrockway@cpan.org>
3 package TestApp::Controller::Root;
6 use base qw/Catalyst::Component::ACCEPT_CONTEXT Catalyst::Controller/;
9 __PACKAGE__->config(namespace => '');
13 $c->stash->{message} = "model";
14 $c->res->body($c->model('Test')->message);
19 $c->stash->{message} = "view";
20 $c->res->body($c->view('Test')->message);
23 sub controller : Global {
25 $c->res->body("controller");
30 $c->res->body($c->model('Test')->foo);
35 $c->model('StashMe')->test;
36 $c->res->body($c->stash->{stashme}->foo);
41 $c->model('StashMe')->test;
43 my $got_cycle = sub { $cycle_ok = 0 };
44 find_cycle($c, $got_cycle);
45 $c->res->body($cycle_ok);
48 sub weak_cycle :Global {
50 $c->model('StashMe')->test;
52 my $got_cycle = sub { $cycle_ok = 1 };
53 find_weakened_cycle($c, $got_cycle);
54 $c->res->body($cycle_ok);