Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfb9d377

Browse files
committed
Added a note about using slashes and the special _format param
1 parent487e918 commitfb9d377

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎routing/slash_in_parameter.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ a more permissive regular expression for it:
7777
7878
That's it! Now, the ``{token}`` parameter can contain the ``/`` character.
7979

80+
..note::
81+
82+
If the route includes the special ``{_format}`` placeholder, you shouldn't
83+
use the ``.+`` requirement for the parameters that allow slashes. For example,
84+
if the pattern is ``/share/{token}.{_format}`` and ``{token}`` allows any
85+
character, the ``/share/foo/bar.json`` URL will consider ``foo/bar.json``
86+
as the token and the format will be empty. This can be solved replacing the
87+
``.+`` requirement by ``[^.]+`` to allow any character except dots.
88+
8089
..note::
8190

8291
If the route defines several placeholders and you apply this permissive

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp