From: Sebastian Riedel Date: Tue, 1 Nov 2005 03:35:15 +0000 (+0000) Subject: Added $c->config->{show_internal_actions} X-Git-Tag: 5.7099_04~1068 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=b0bb11ec8c056e043e87cd7733125ffc9d9bcfb0 Added $c->config->{show_internal_actions} --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index b2f7212..ef0a506 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -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 becomes diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index 31e1d02..5def763 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -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 ); }