Roles
use CatalystX::Declare;
- controller_role MyApp::Web::ControllerRole::Bar {
+ component_role MyApp::Web::ControllerRole::Bar {
use MyApp::Types qw( Username );
use CatalystX::Declare;
# almost like a normal Moose role
-controller_role MyApp::Web::ControllerRole::RenderView {
+component_role MyApp::Web::ControllerRole::RenderView {
# we can use the whole Moose infrastructure
use MooseX::Types::Moose qw( Str );
around keywords {
$self->$orig,
ControllerKeyword->new(identifier => 'controller'),
- RoleKeyword->new(identifier => 'controller_role'),
+ RoleKeyword->new(identifier => 'component_role'),
ApplicationKeyword->new(identifier => 'application'),
}
}
use CatalystX::Declare;
- controller_role MyApp::Web::ControllerRole::Bar {
+ component_role MyApp::Web::ControllerRole::Bar {
use MyApp::Types qw( Username );
use CatalystX::Declare;
- controller_role MyApp::Web::ControllerRole::RichBase {
+ component_role MyApp::Web::ControllerRole::RichBase {
before base (Object $ctx) {
$ctx->stash(something => $ctx->model('Item'));
use CatalystX::Declare;
- controller_role MyApp::Web::ControllerRole::Foo {
+ component_role MyApp::Web::ControllerRole::Foo {
method provided_method { ... }
=head1 DESCRIPTION
-This handler provides the C<controller_role> keyword. It is an extension of the
+This handler provides the C<component_role> keyword. It is an extension of the
L<MooseX::Declare::Syntax::Keyword::Role> handler. Like with declared
controllers, the C<method> keyword and the modifiers are provided. For details
on the syntax for action declarations have a look at
use CatalystX::Declare;
-controller_role TestApp::ControllerRole::Composed {
+component_role TestApp::ControllerRole::Composed {
method composed_method { }
action composed_action;
}
use CatalystX::Declare;
-controller_role TestApp::TestRole {
+component_role TestApp::TestRole {
method something_from_the_role { 23 }