Navigation Menu

Skip to content

Commit

Permalink
show a few more route variations
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 5, 2014
1 parent bc51577 commit 0f7a2e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -497,8 +497,8 @@ expressions.

To share code with multiple nested routes you can use
L<Mojolicious::Routes::Route/"under">, because unlike normal nested routes,
routes generated with it have their own intermediate destination and result in
additional dispatch cycles when they match.
the routes generated with it have their own intermediate destination and
result in additional dispatch cycles when they match.

# /foo -> undef
# /foo/bar -> {controller => 'foo', action => 'baz'}
Expand Down
1 change: 1 addition & 0 deletions lib/Mojolicious/Lite.pm
Expand Up @@ -1026,6 +1026,7 @@ automatically exported.
my $route = any '/:foo' => {foo => 'bar'} => sub {...};
my $route = any '/:foo' => [foo => qr/\w+/] => sub {...};
my $route = any [qw(GET POST)] => '/:foo' => sub {...};
my $route = any [qw(GET POST)] => '/:foo' => [foo => qr/\w+/] => sub {...};
Generate route with L<Mojolicious::Routes::Route/"any">, matching any of the
listed HTTP request methods or all. See also the tutorial above for many more
Expand Down
1 change: 1 addition & 0 deletions lib/Mojolicious/Routes/Route.pm
Expand Up @@ -312,6 +312,7 @@ current parent if necessary.
my $route = $r->any('/:foo' => {foo => 'bar'} => sub {...});
my $route = $r->any('/:foo' => [foo => qr/\w+/] => sub {...});
my $route = $r->any([qw(GET POST)] => '/:foo' => sub {...});
my $route = $r->any([qw(GET POST)] => '/:foo' => [foo => qr/\w+/]);
Generate L<Mojolicious::Routes::Route> object matching any of the listed HTTP
request methods or all. See also the L<Mojolicious::Lite> tutorial for many
Expand Down

0 comments on commit 0f7a2e7

Please sign in to comment.