Skip to content

Commit

Permalink
Inform about JMSI18nRoutingBundle compatibility
Browse files Browse the repository at this point in the history
FOSJsRoutingBundle 2.3.0 introduced domain feature that prevents dumping JMSI18nRoutingBundle routes
  • Loading branch information
benjamintoussaint committed Feb 19, 2019
1 parent 552c00c commit bf86a2c
Showing 1 changed file with 21 additions and 0 deletions.
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

0 comments on commit bf86a2c

Please sign in to comment.