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

Add a note about RouteDefaultsValidator #694

Merged
merged 1 commit into from
Aug 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bundles/routing/dynamic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions bundles/routing/dynamic_customize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.