-
-
Save anonymous/4e1944be44244056e89f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Mojolicious/Routes.pm b/lib/Mojolicious/Routes.pm | |
index e98b44c..eb81fe6 100644 | |
--- a/lib/Mojolicious/Routes.pm | |
+++ b/lib/Mojolicious/Routes.pm | |
@@ -114,8 +114,17 @@ sub _add { | |
sub _callback { | |
my ($self, $c, $cb, $last) = @_; | |
$c->stash->{'mojo.routed'}++ if $last; | |
+ | |
+ # Callback | |
my $app = $c->app; | |
- $app->log->debug('Routing to a callback.'); | |
+ if (ref $cb) { $app->log->debug('Routing to a callback.') } | |
+ | |
+ # Helper | |
+ else { | |
+ $app->log->debug(qq{Routing to helper "$cb".}); | |
+ return undef unless $cb = $app->renderer->get_helper($cb); | |
+ } | |
+ | |
return _action($app, $c, $cb, $last); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment