From bf86a2c033e1e4912f385118004fcdd21064cb02 Mon Sep 17 00:00:00 2001 From: Benjamin Toussaint <7239074+benjamintoussaint@users.noreply.github.com> Date: Fri, 15 Feb 2019 10:57:51 +0100 Subject: [PATCH] Inform about JMSI18nRoutingBundle compatibility FOSJsRoutingBundle 2.3.0 introduced domain feature that prevents dumping JMSI18nRoutingBundle routes --- Resources/doc/usage.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Resources/doc/usage.rst b/Resources/doc/usage.rst index abb11279..deaea766 100644 --- a/Resources/doc/usage.rst +++ b/Resources/doc/usage.rst @@ -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 @@ -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