more docs and examples
John Napiorkowski [Fri, 13 Aug 2010 20:33:58 +0000 (16:33 -0400)]
lib/CatalystX/Declare/Keyword/Action.pm
t/lib/TestApp/Controller/ActionParams.pm

index 5072c32..eb4f20e 100644 (file)
@@ -239,7 +239,6 @@ class CatalystX::Declare::Keyword::Action {
                     my $parameters = ref $params{$key} eq 'ARRAY' ? @{$params{$key}} : $params{$key};
                     push @{$attrs->{$key}}, $parameters;
                 }
-                $attrs->{_role_attributes}->{$role} = \%params;
             }          
 
             if (defined(my $alias = $self->_check_for_available_import($ctx, $role))) {
@@ -807,22 +806,10 @@ attributes:
 
     sub User :Action :Does(Permissions) :roles(admin) :roles(member)
 
-However, I realize this method could lead to namespace collisions.  So in
-addition to putting paramters into $action->attributes, we also populate a
-special key "_role_attributes", which will preserve parameters by role:
-
-    $action->attributes->{_role_attributes}->{$role} = \%params;
-
-So the following:
-
-    action User with Permissions(roles=>[qw/admin member/]) {}
-
-Creates:
-
-    $action->attributes->{_role_attributes}->{Permissions}
-      = {roles=>[qw/admin member/]};
-
-For now you should only use this for your private code.  
+However, I realize this method could lead to namespace collisions within the
+C<$action->attributes> attribute.  For now this is an avoidable issue.  In the
+future we may add a C<$action->trait_attributes> or similar attribute to the
+L<Catalyst::Action> class in order to resolve this issue.
 
 =head2 Action Classes
 
index 20569b4..4b524a7 100644 (file)
@@ -52,9 +52,6 @@ controller ::Controller::ActionParams {
         my $p1 = $ctx->controller->action_for('forth')->p1;
         my $p2 = $ctx->controller->action_for('forth')->p2;
         $ctx->response->body("action_args_forth: $p1,$p2");
-
-
-        $ctx->_dump($ctx->controller->action_for('forth'));
     }
 }