File: ActionRoles.pm

package info (click to toggle)
libcatalyst-perl 5.90132-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,016 kB
  • sloc: perl: 11,061; makefile: 7
file content (30 lines) | stat: -rw-r--r-- 620 bytes parent folder | download | duplicates (4)
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
package TestApp::Controller::ActionRoles;

use Moose;

BEGIN { extends 'Catalyst::Controller' }

__PACKAGE__->config(
    action_roles => ['~Kooh'],
    action_args => {
        frew => { boo => 'hello' },
    },
);

sub foo  : Local Does('Guff')  {}
sub bar  : Local Does('~Guff') {}
sub baz  : Local Does('+Guff') {}
sub quux : Local Does('Zoo')  {}

sub corge : Local Does('Guff') ActionClass('TestAfter') {
    my ($self, $ctx) = @_;
    $ctx->stash(after_message => 'moo');
}

sub frew : Local Does('Boo')  {
    my ($self, $ctx) = @_;
    my $boo = $ctx->stash->{action_boo};
    $ctx->response->body($boo);
}

1;