Skip to content
Merged
Changes from all commits
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
17 changes: 17 additions & 0 deletions routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,23 @@ should be used during the request. Defining routes this way also eliminated the
need for duplicate registration of routes which minimizes the risk for any bugs
caused by definition inconsistency.

A common requirement for internationalized applications is to prefix all routes
with a locale. This can be done by defining a different prefix for each locale
(and setting an empty prefix for your default locale if you prefer it):

.. configuration-block::

.. code-block:: yaml

# config/routes/annotations.yaml
controllers:
resource: '../src/Controller/'
type: annotation
prefix:
en: '' # don't prefix URLs for English, the default locale
fr: '/fr'
es: '/es'

.. _routing-requirements:

Adding {wildcard} Requirements
Expand Down