X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FDispatcher.pm;fp=lib%2FCatalyst%2FDispatcher.pm;h=e1fd0c8d226331d843c770fb2f25703202cee4df;hb=cb689891b91e9343d8d3784908f73d68b9933e05;hp=ab540e33ca1c77277f14997374200c736a34eeb6;hpb=0a2c51b79f14fb8e51701bacf600c2160b1aff52;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index ab540e3..e1fd0c8 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -312,6 +312,19 @@ sub _invoke_as_component { if( $component_or_class eq blessed($c->application) ){ my $possible_action = $c->application->action_for($method); return $possible_action if $possible_action; + if( my $code = $c->application->can($method) ){ + return $self->_method_action_class->new( + { + name => $method, + code => $code, + reverse => "$component_or_class->$method", + class => $component_or_class, + namespace => Catalyst::Utils::class2prefix( + $component_or_class, $c->config->{case_sensitive} + ), + } + ); + } } my $component = $self->_find_component($c, $component_or_class); my $component_class = blessed $component || return 0;