patch to make prepare_parameters not be both a builder and a preparer
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Moose.pm
1 package TestApp::Controller::Moose;
2
3 use Moose;
4
5 use namespace::clean -except => 'meta';
6
7 BEGIN { extends qw/Catalyst::Controller/; }
8 use MooseX::MethodAttributes; # FIXME - You need to say this if you have
9                               #         modifiers so that you get the correct
10                               #         method metaclass, why does the modifier
11                               #         on MODIFY_CODE_ATTRIBUTES not work.
12
13 has attribute => (
14     is      => 'ro',
15     default => 42,
16 );
17
18 sub get_attribute : Local {
19     my ($self, $c) = @_;
20     $c->response->body($self->attribute);
21 }
22
23 sub with_local_modifier : Local {
24     my ($self, $c) = @_;
25     $c->forward('get_attribute');
26 }
27
28 before with_local_modifier => sub {
29     my ($self, $c) = @_;
30     $c->response->header( 'X-Catalyst-Test-Before' => 'before called' );
31 };
32
33 1;