diff --git a/bundles/routing/dynamic.rst b/bundles/routing/dynamic.rst index 1ff96349..cae21082 100644 --- a/bundles/routing/dynamic.rst +++ b/bundles/routing/dynamic.rst @@ -278,6 +278,11 @@ Of course you can also have several parameters, as with normal Symfony routes. The semantics and rules for patterns, defaults and requirements are exactly the same as in core routes. +.. note:: + + The ``RouteDefaultsValidator`` validates the route defaults parameters. + For more information, see :ref:`bundle-routing-route-defaults-validator`. + Your controller can expect the ``$id`` parameter as well as the ``$contentDocument`` as you set a content on the route. The content could be used to define an intro section that is the same for each project or other shared data. If you don't diff --git a/bundles/routing/dynamic_customize.rst b/bundles/routing/dynamic_customize.rst index 23084fd2..933f2e4a 100644 --- a/bundles/routing/dynamic_customize.rst +++ b/bundles/routing/dynamic_customize.rst @@ -156,3 +156,16 @@ information on creating custom services. .. _`Creating and configuring services in the container`: http://symfony.com/doc/current/book/service_container.html#creating-configuring-services-in-the-container/ .. _`PHPCR-ODM`: http://www.doctrine-project.org/projects/phpcr-odm.html + +.. _bundle-routing-route-defaults-validator: + +The RouteDefaultsValidator +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The route ``getDefaults`` method has a ``RouteDefaults`` constraint. +When a route is validated, the ``RouteDefaultsValidator`` will be called. +If the ``_controller`` or the ``_template`` defaults are set, the validator +will check that they exist. + +You can override the validator by setting the +``cmf_routing.validator.route_defaults.class`` parameter.