Skip to content

Commit

Permalink
added hook example for skipping dispatchers
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 17, 2011
1 parent 0eccdc7 commit f075d6d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/Mojolicious.pm
Expand Up @@ -462,6 +462,13 @@ and the application object, as well as a function in C<ep> templates.
Extend L<Mojolicious> by adding hooks.
# Dispatchers will be skipped if there's already a response code defined
$app->hook(before_dispatch => sub {
my $c = shift;
$c->render(text => 'Skip both dispatchers!')
if $c->req->url->path->contains('/do_not_dispatch');
});
These hooks are currently available and are emitted in the listed order:
=over 2
Expand Down

0 comments on commit f075d6d

Please sign in to comment.