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

Commit 70b206a

Browse files
committed
Merge pull request #694 from EmmanuelVella/route-defaults-validator
Add a note about RouteDefaultsValidator
2 parents 51fd613 + 4062f83 commit 70b206a

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
@@ -281,6 +281,11 @@ Of course you can also have several parameters, as with normal Symfony
281281
routes. The semantics and rules for patterns, defaults and requirements are
282282
exactly the same as in core routes.
283283

284+
.. note::
285+
286+
The ``RouteDefaultsValidator`` validates the route defaults parameters.
287+
For more information, see :ref:`bundle-routing-route-defaults-validator`.
288+
284289
Your controller can expect the ``$id`` parameter as well as the ``$contentDocument``
285290
as you set a content on the route. The content could be used to define an intro
286291
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
@@ -188,3 +188,16 @@ yourself and configure that service:
188188
189189
.. _`Creating and configuring services in the container`: http://symfony.com/doc/current/book/service_container.html#creating-configuring-services-in-the-container/
190190
.. _`PHPCR-ODM`: http://www.doctrine-project.org/projects/phpcr-odm.html
191+
192+
.. _bundle-routing-route-defaults-validator:
193+
194+
The RouteDefaultsValidator
195+
~~~~~~~~~~~~~~~~~~~~~~~~~~
196+
197+
The route ``getDefaults`` method has a ``RouteDefaults`` constraint.
198+
When a route is validated, the ``RouteDefaultsValidator`` will be called.
199+
If the ``_controller`` or the ``_template`` defaults are set, the validator
200+
will check that they exist.
201+
202+
You can override the validator by setting the
203+
``cmf_routing.validator.route_defaults.class`` parameter.

0 commit comments

Comments
 (0)