Added config->{namespace}
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Base.pm
index 9aa4dbf..42f28be 100644 (file)
@@ -44,7 +44,7 @@ sub _AUTO : Private {
 sub _ACTION : Private {
     my ( $self, $c ) = @_;
     if (   ref $c->action
-        && $c->action->isa('Catalyst::Action')
+        && $c->action->can('execute')
         && $c->req->action )
     {
         $c->action->execute($c);
@@ -74,20 +74,19 @@ Catalyst Base Class
 
 =head1 METHODS
 
-=over 4
-
-=item $self->action_namespace($c)
+=head2 $self->action_namespace($c)
 
 =cut
 
 sub action_namespace {
     my ( $self, $c ) = @_;
-    return Catalyst::Utils::class2prefix( ref $self,
+    return $self->config->{namespace} if exists $self->config->{namespace};
+    return Catalyst::Utils::class2prefix( ref($self) || $self,
         $c->config->{case_sensitive} )
       || '';
 }
 
-=item $self->register_actions($c)
+=head2 $self->register_actions($c)
 
 =cut
 
@@ -155,8 +154,6 @@ sub _parse_attrs {
     return \%attributes;
 }
 
-=back
-
 =head1 SEE ALSO
 
 L<Catalyst>, L<Catalyst::Controller>.