Added $c->config->{show_internal_actions}
Sebastian Riedel [Tue, 1 Nov 2005 03:35:15 +0000 (03:35 +0000)]
lib/Catalyst.pm
lib/Catalyst/Dispatcher.pm

index b2f7212..ef0a506 100644 (file)
@@ -1562,6 +1562,16 @@ sub version { return $Catalyst::VERSION }
 
 =back
 
+=head1 INTERNAL ACTIONS
+
+Catalyst uses internal actions like C<_DISPATCH>, C<_BEGIN>, C<_AUTO>
+C<_ACTION> and C<_END>, these are by default not shown in the private
+action table.
+
+But you can deactivate this with a config parameter.
+
+    MyApp->config->{show_internal_actions} = 1;
+
 =head1 CASE SENSITIVITY
 
 By default Catalyst is not case sensitive, so C<MyApp::C::FOO::Bar> becomes
index 31e1d02..5def763 100644 (file)
@@ -55,7 +55,7 @@ sub dispatch {
     my ( $self, $c ) = @_;
 
     if ( $c->action ) {
-        $c->forward( join('/', '', $c->namespace, '_DISPATCH') );
+        $c->forward( join( '/', '', $c->namespace, '_DISPATCH' ) );
     }
 
     else {
@@ -448,6 +448,9 @@ sub setup_actions {
 
         for my $action ( keys %{$node} ) {
             my $action_obj = $node->{$action};
+            next
+              if ( ( $action =~ /^_.*/ )
+                && ( !$c->config->{show_internal_actions} ) );
             $privates->addRow( "$prefix$action", $action_obj->class );
         }