Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 9722272

Browse files
committed
Add RouteDefaultsValidator doc
1 parent 9bc4682 commit 9722272

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

bundles/routing/dynamic.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ Of course you can also have several parameters, as with normal Symfony
278278
routes. The semantics and rules for patterns, defaults and requirements are
279279
exactly the same as in core routes.
280280

281+
.. note::
282+
283+
The ``RouteDefaultsValidator`` validates the route defaults parameters.
284+
For more information, see :ref:`<_bundle-routing-route-defaults-validator>`.
285+
281286
Your controller can expect the ``$id`` parameter as well as the ``$contentDocument``
282287
as you set a content on the route. The content could be used to define an intro
283288
section that is the same for each project or other shared data. If you don't

bundles/routing/dynamic_customize.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,16 @@ information on creating custom services.
156156

157157
.. _`Creating and configuring services in the container`: http://symfony.com/doc/current/book/service_container.html#creating-configuring-services-in-the-container/
158158
.. _`PHPCR-ODM`: http://www.doctrine-project.org/projects/phpcr-odm.html
159+
160+
.. _bundle-routing-route-defaults-validator:
161+
162+
The RouteDefaultsValidator
163+
~~~~~~~~~~~~~~~~~~~~~~~~~~
164+
165+
The route ``getDefaults`` method has a ``RouteDefaults`` constraint.
166+
When a route is validated, the ``RouteDefaultsValidator`` will be called.
167+
If the ``_controller`` or the ``_template`` defaults are set, the validator
168+
will check that they exist.
169+
170+
You can override the validator by setting the
171+
``cmf_routing.validator.route_defaults.class`` parameter.

0 commit comments

Comments
 (0)