Commit | Line | Data |
734a1e11 |
1 | package TestApp::Controller::Action::Action; |
2 | |
3 | use strict; |
4 | use base 'TestApp::Controller::Action'; |
5 | |
d87210ec |
6 | __PACKAGE__->config( |
7 | actions => { |
7d81af7e |
8 | '*' => { extra_attribute => 13 }, |
9 | action_action_five => { ActionClass => '+Catalyst::Action::TestBefore' }, |
10 | action_action_eight => { another_extra_attribute => 'foo' }, |
d87210ec |
11 | }, |
12 | action_args => { |
13 | '*' => { extra_arg => 42 }, |
14 | action_action_seven => { another_extra_arg => 23 }, |
15 | }, |
16 | ); |
5d8129e9 |
17 | |
734a1e11 |
18 | sub action_action_one : Global : ActionClass('TestBefore') { |
19 | my ( $self, $c ) = @_; |
20 | $c->res->header( 'X-Action', $c->stash->{test} ); |
21 | $c->forward('TestApp::View::Dump::Request'); |
22 | } |
23 | |
24 | sub action_action_two : Global : ActionClass('TestAfter') { |
25 | my ( $self, $c ) = @_; |
26 | $c->stash->{after_message} = 'awesome'; |
27 | $c->forward('TestApp::View::Dump::Request'); |
28 | } |
29 | |
30 | sub action_action_three : Global : ActionClass('+TestApp::Action::TestBefore') { |
31 | my ( $self, $c ) = @_; |
32 | $c->forward('TestApp::View::Dump::Request'); |
33 | } |
34 | |
9287719b |
35 | sub action_action_four : Global : MyAction('TestMyAction') { |
36 | my ( $self, $c ) = @_; |
37 | $c->forward('TestApp::View::Dump::Request'); |
38 | } |
39 | |
5d8129e9 |
40 | sub action_action_five : Global { |
41 | my ( $self, $c ) = @_; |
42 | $c->res->header( 'X-Action', $c->stash->{test} ); |
43 | $c->forward('TestApp::View::Dump::Request'); |
44 | } |
45 | |
46 | sub action_action_six : Global : ActionClass('~TestMyAction') { |
47 | my ( $self, $c ) = @_; |
48 | $c->forward('TestApp::View::Dump::Request'); |
49 | } |
50 | |
d87210ec |
51 | sub action_action_seven : Global : ActionClass('~TestExtraArgsAction') { |
52 | my ( $self, $c ) = @_; |
53 | $c->forward('TestApp::View::Dump::Request'); |
54 | } |
55 | |
7d81af7e |
56 | sub action_action_eight : Global { |
57 | my ( $self, $c ) = @_; |
58 | $c->forward('TestApp::View::Dump::Action'); |
59 | } |
60 | |
734a1e11 |
61 | 1; |