8000 [Routing][DX] Exposed "utf8" options, and defaults "locale" and "format" by HeahDude · Pull Request #11126 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content
< 8000 turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class="">

[Routing][DX] Exposed "utf8" options, and defaults "locale" and "format" #11126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 25, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup
  • Loading branch information
HeahDude committed Mar 17, 2019
commit f9e2eaa1d1de665e452d417728fcd3d85787e4d4
7 changes: 3 additions & 4 deletions routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ that are special: each adds a unique piece of functionality inside your applicat
``_locale``
Used to set the locale on the request (:ref:`read more <translation-locale-url>`).

You can also use special attributes to configure them:
You can also use special attributes to configure them (except ``_fragment``):

.. configuration-block::

Expand All @@ -761,7 +761,6 @@ You can also use special attributes to configure them:
* "/articles/{_locale}/search.{_format}",
* locale="en",
* format="html",
* fragment="first-result-id",
* requirements={
* "_locale": "en|fr",
* "_format": "html|xml",
Expand Down Expand Up @@ -802,7 +801,6 @@ You can also use special attributes to configure them:

<requirement key="_locale">en|fr</requirement>
<requirement key="_format">html|rss</requirement>
<requirement key="year">\d+</requirement>

</route>
</routes>
Expand All @@ -822,11 +820,12 @@ You can also use special attributes to configure them:
->requirements([
'_locale' => 'en|fr',
'_format' => 'html|rss',
'year' => '\d+',
])
;
};

Those attributes can also be used for imports.

.. versionadded::

The special attributes has been introduced in Symfony 4.3.
Expand Down
0