Commit | Line | Data |
c2a8165b |
1 | use CatalystX::Declare; |
2 | |
dd2759b0 |
3 | controller_role TestApp::ControllerRole::Parameterized (Str :$message, Str :$base, Str :$part, Str :$action) { |
c2a8165b |
4 | |
5 | method get_message { $message } |
6 | |
7 | final action greet under base { |
c2a8165b |
8 | $ctx->response->body( join ':', $self->get_message, $message ); |
9 | } |
8d66ec34 |
10 | |
11 | final action dynabase under "$base" { |
12 | $ctx->response->body( "under $base" ); |
13 | } |
14 | |
15 | final action dynapart under "$base" as $part { |
16 | $ctx->response->body( "under $base as $part" ); |
17 | } |
18 | |
19 | under $base { |
20 | |
21 | final action scoped { |
22 | $ctx->response->body( "scoped under $base" ); |
23 | } |
3601c77d |
24 | |
25 | final action complex as "$part/deep" { |
26 | $ctx->response->body( "$part/deep under $base" ); |
27 | } |
dd2759b0 |
28 | |
29 | final action $action { |
30 | $ctx->response->body( "$action action" ); |
31 | } |
32 | |
33 | final action actionalias { |
34 | $self->$action($ctx); |
35 | } |
8d66ec34 |
36 | } |
1754e3e7 |
37 | |
38 | my $upper_part = uc $part; |
39 | |
40 | final action upper as $upper_part under $base { |
41 | $ctx->response->body("upper as $upper_part under $base"); |
42 | } |
56929b96 |
43 | |
44 | final action short <- $base (Str $x) { |
45 | $ctx->response->body('short ' . $x); |
46 | } |
c2a8165b |
47 | } |