Skip to content

Commit

Permalink
mention that we use a special type of restrictive placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 25, 2015
1 parent fe37250 commit 4d9621b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -586,9 +586,9 @@ allowed formats.
# /foo.xml -> {controller => 'foo', action => 'bar', format => 'xml'}
$r->get('/foo' => [format => [qw(rss xml)]])->to('foo#bar');

Or you can just disable format detection, which gets inherited by nested
routes, and then re-enable it selectively on demand with restrictive
placeholders.
Or you can just disable format detection with a special type of restrictive
placeholder, which gets inherited by nested routes, and then re-enable it on
demand.

# /foo -> {controller => 'foo', action => 'bar'}
# /foo.html -> undef
Expand Down
5 changes: 3 additions & 2 deletions lib/Mojolicious/Guides/Tutorial.pod
Expand Up @@ -590,14 +590,15 @@ limit possible values.

app->start;

Or you can just disable format detection.
Or you can just disable format detection with a special type of restrictive
placeholder.

use Mojolicious::Lite;

# /hello
get '/hello' => [format => 0] => {text => 'No format detection.'};

# Disable detection and allow the following routes selective re-enabling
# Disable detection and allow the following routes to re-enable it on demand
under [format => 0];

# /foo
Expand Down

0 comments on commit 4d9621b

Please sign in to comment.