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

Commit 36e7baf

Browse files
committed
Add RouteDefaultsValidator doc
1 parent 9bc4682 commit 36e7baf

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,17 @@ 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+
.. index:: Route Defaults Validator
161+
.. _bundle-routing-route-defaults-validator:
162+
163+
The RouteDefaultsValidator
164+
~~~~~~~~~~~~~~~~~~~~~~~~~~
165+
166+
The route ``getDefaults`` method has a ``RouteDefaults`` constraint.
167+
When a route is validated, the ``RouteDefaultsValidator`` will be called.
168+
If the ``_controller`` or the ``_template`` defaults are set, the validator
169+
will check that they exist.
170+
171+
You can override the validator by setting the
172+
``cmf_routing.validator.route_defaults.class`` parameter.

0 commit comments

Comments
 (0)