[Catalyst-commits] r13358 - Catalyst-Runtime/5.80/branches/tweak_controller_action_creation/lib/Catalyst

jnapiorkowski at dev.catalyst.perl.org jnapiorkowski at dev.catalyst.perl.org
Wed Jun 16 19:55:08 GMT 2010


Author: jnapiorkowski
Date: 2010-06-16 20:55:08 +0100 (Wed, 16 Jun 2010)
New Revision: 13358

Modified:
   Catalyst-Runtime/5.80/branches/tweak_controller_action_creation/lib/Catalyst/Controller.pm
Log:
broke out and documented action_class method

Modified: Catalyst-Runtime/5.80/branches/tweak_controller_action_creation/lib/Catalyst/Controller.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/tweak_controller_action_creation/lib/Catalyst/Controller.pm	2010-06-16 19:12:46 UTC (rev 13357)
+++ Catalyst-Runtime/5.80/branches/tweak_controller_action_creation/lib/Catalyst/Controller.pm	2010-06-16 19:55:08 UTC (rev 13358)
@@ -248,16 +248,25 @@
     }
 }
 
-sub create_action {
+sub action_class {
     my $self = shift;
     my %args = @_;
 
     my $class = (exists $args{attributes}{ActionClass}
-                    ? $args{attributes}{ActionClass}[0]
-                    : $self->_action_class);
+        ? $args{attributes}{ActionClass}[0]
+        : $self->_action_class);
+
     Class::MOP::load_class($class);
+    return $class;
+}
 
+sub create_action {
+    my $self = shift;
+    my %args = @_;
+
+    my $class = $self->action_class(%args);
     my $action_args = $self->config->{action_args};
+
     my %extra_args = (
         %{ $action_args->{'*'}           || {} },
         %{ $action_args->{ $args{name} } || {} },
@@ -529,6 +538,11 @@
 Creates action objects for a set of action methods using C< create_action >,
 and registers them with the dispatcher.
 
+=head2 $self->action_class(%args)
+
+Used when a controller is creating an action to determine the correct base
+action class to use.  
+
 =head2 $self->create_action(%args)
 
 Called with a hash of data to be use for construction of a new




More information about the Catalyst-commits mailing list