Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 597295c

Browse files
chrismcmackenweaverryan
authored andcommitted
Added clarification on routes ending in optional params
1 parent 46dfc42 commit 597295c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

book/routing.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,12 @@ match, giving the ``page`` parameter a value of ``2``. Perfect.
415415
| /blog/2 | {page} = 2 |
416416
+---------+------------+
417417

418+
.. tip::
419+
420+
Routes with optional parameters at the end will not match on requests
421+
with a trailing slash (i.e. /blog/). In this case the slash is a separator and
422+
should not be used if the optional parameter isn't passed.
423+
418424
.. index::
419425
single: Routing; Requirements
420426

0 commit comments

Comments
 (0)