File: Action.pm

package info (click to toggle)
libcatalyst-perl 5.90130-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,000 kB
  • sloc: perl: 10,925; makefile: 7
file content (65 lines) | stat: -rw-r--r-- 1,923 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package TestApp::Controller::Action::Action;

use strict;
use base 'TestApp::Controller::Action';

__PACKAGE__->config(
    actions => {
        '*'                 => { extra_attribute  => 13 },
        action_action_five  => { ActionClass => '+Catalyst::Action::TestBefore' },
        action_action_eight => { another_extra_attribute => 'foo' },
    },
    action_args => {
        '*'                 => { extra_arg         => 42 },
        action_action_seven => { another_extra_arg => 23 },
    },
);

sub action_action_one : Global : ActionClass('TestBefore') {
    my ( $self, $c ) = @_;
    $c->res->header( 'X-Action', $c->stash->{test} );
    $c->forward('TestApp::View::Dump::Request');
}

sub action_action_two : Global : ActionClass('TestAfter') {
    my ( $self, $c ) = @_;
    $c->stash->{after_message} = 'awesome';
    $c->forward('TestApp::View::Dump::Request');
}

sub action_action_three : Global : ActionClass('+TestApp::Action::TestBefore') {
    my ( $self, $c ) = @_;
    $c->forward('TestApp::View::Dump::Request');
}

sub action_action_four : Global : MyAction('TestMyAction') {
    my ( $self, $c ) = @_;
    $c->forward('TestApp::View::Dump::Request');
}

sub action_action_five : Global {
    my ( $self, $c ) = @_;
    $c->res->header( 'X-Action', $c->stash->{test} );
    $c->forward('TestApp::View::Dump::Request');
}

sub action_action_six : Global : ActionClass('~TestMyAction') {
    my ( $self, $c ) = @_;
    $c->forward('TestApp::View::Dump::Request');
}

sub action_action_seven : Global : ActionClass('~TestExtraArgsAction') {
    my ( $self, $c ) = @_;
    $c->forward('TestApp::View::Dump::Request');
}

sub action_action_eight : Global  {
    my ( $self, $c ) = @_;
    $c->forward('TestApp::View::Dump::Action');
}

sub action_action_nine : Global : ActionClass('~TestActionArgsFromConstructor') {
    my ( $self, $c ) = @_;
    $c->forward('TestApp::View::Dump::Request');
}
1;