Skip to content
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

Inform about JMSI18nRoutingBundle compatibility #352

Merged
merged 1 commit into from Aug 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions Resources/doc/usage.rst
Expand Up @@ -140,6 +140,24 @@ Moreover, you can configure a list of routes to expose in ``app/config/config.ym
These routes will be added to the exposed routes. You can use regular expression
patterns if you don't want to list all your routes name by name.

.. note::

If you're using `JMSI18nRoutingBundle`_ for your internationalized routes, your exposed routes must now match the bundle locale-prefixed routes, so you could either specify each locale by hand in the routes names, or use a regular expression to match all of your locales at once:

.. code-block:: yaml

# app/config/config.yml
fos_js_routing:
routes_to_expose: [ en__RG__route_1, en__RG__route_2, ... ]

.. code-block:: yaml

# app/config/config.yml
fos_js_routing:
routes_to_expose: [ '[a-z]{2}__RG__route_1', '[a-z]{2}__RG__route_2', ... ]

Note that `Symfony 4.1 added support for internationalized routes`_ out-of-the-box.

You can prevent to expose a route by configuring it as below:

.. code-block:: yaml
Expand Down Expand Up @@ -179,3 +197,6 @@ You can enable HTTP caching as below:
smaxage: null # integer value, e.g. 300
expires: null # anything that can be fed to "new \DateTime($expires)", e.g. "5 minutes"
vary: [] # string or array, e.g. "Cookie" or [ Cookie, Accept ]

.. _`JMSI18nRoutingBundle`: https://github.com/schmittjoh/JMSI18nRoutingBundle
.. _`Symfony 4.1 added support for internationalized routes`: https://symfony.com/blog/new-in-symfony-4-1-internationalized-routing