Skip to content

Commit bf86a2c

Browse files
Inform about JMSI18nRoutingBundle compatibility
FOSJsRoutingBundle 2.3.0 introduced domain feature that prevents dumping JMSI18nRoutingBundle routes
1 parent 552c00c commit bf86a2c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Resources/doc/usage.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,24 @@ Moreover, you can configure a list of routes to expose in ``app/config/config.ym
140140
These routes will be added to the exposed routes. You can use regular expression
141141
patterns if you don't want to list all your routes name by name.
142142

143+
.. note::
144+
145+
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:
146+
147+
.. code-block:: yaml
148+
149+
# app/config/config.yml
150+
fos_js_routing:
151+
routes_to_expose: [ en__RG__route_1, en__RG__route_2, ... ]
152+
153+
.. code-block:: yaml
154+
155+
# app/config/config.yml
156+
fos_js_routing:
157+
routes_to_expose: [ '[a-z]{2}__RG__route_1', '[a-z]{2}__RG__route_2', ... ]
158+
159+
Note that `Symfony 4.1 added support for internationalized routes`_ out-of-the-box.
160+
143161
You can prevent to expose a route by configuring it as below:
144162

145163
.. code-block:: yaml
@@ -179,3 +197,6 @@ You can enable HTTP caching as below:
179197
smaxage: null # integer value, e.g. 300
180198
expires: null # anything that can be fed to "new \DateTime($expires)", e.g. "5 minutes"
181199
vary: [] # string or array, e.g. "Cookie" or [ Cookie, Accept ]
200+
201+
.. _`JMSI18nRoutingBundle`: https://github.com/schmittjoh/JMSI18nRoutingBundle
202+
.. _`Symfony 4.1 added support for internationalized routes`: https://symfony.com/blog/new-in-symfony-4-1-internationalized-routing

0 commit comments

Comments
 (0)