broke out and documented action_class method
John Napiorkowski [Wed, 16 Jun 2010 19:55:08 +0000 (19:55 +0000)]
lib/Catalyst/Controller.pm

index fbc8768..e1d7d04 100644 (file)
@@ -248,16 +248,25 @@ sub register_action_methods {
     }
 }
 
-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 @@ action methods for this package.
 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