1 package TestApp::Controller::ContextClosure;
6 extends 'Catalyst::Controller';
7 with 'Catalyst::Component::ContextClosure';
10 sub normal_closure : Local {
11 my ($self, $ctx) = @_;
12 $ctx->stash(closure => sub {
13 $ctx->response->body('from normal closure');
15 $ctx->response->body('stashed normal closure');
18 sub context_closure : Local {
19 my ($self, $ctx) = @_;
20 $ctx->stash(closure => $self->make_context_closure(sub {
22 $ctx->response->body('from context closure');
24 $ctx->response->body('stashed context closure');
27 __PACKAGE__->meta->make_immutable;