From ea3d231ea2bd1ea7b4b5937f7c699f0bf8de3366 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 20 Dec 2014 23:53:43 +0100 Subject: [PATCH] document the `2.5` validation options --- reference/configuration/framework.rst | 71 +++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index bdbaf06aa96..33299d3cf97 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -48,6 +48,12 @@ Configuration * `translator`_ * :ref:`enabled ` * `fallback`_ +* `validation`_ + * `cache`_ + * `enable_annotations`_ + * `translation_domain`_ + * `strict_email`_ + * `api`_ secret ~~~~~~ @@ -517,6 +523,70 @@ This option is used when the translation key for the current locale wasn't found For more details, see :doc:`/book/translation`. +validation +~~~~~~~~~~ + +cache +..... + +**type**: ``string`` + +This value is used to determine the service that is used to persist class +metadata in a cache. The actual service name is built by prefixing the configured +value with ``validator.mapping.cache.`` (e.g. if the value is ``apc``, the +``validator.mapping.cache.apc`` service will be injected). The service has +to implement the :class:`Symfony\\Component\\Validator\\Mapping\\Cache\\CacheInterface`. + +enable_annotations +.................. + +**type**: ``Boolean`` **default**: ``false`` + +If this option is enabled, validation constraints can be defined using annotations. + +translation_domain +.................. + +**type**: ``string`` **default**: ``validators`` + +The translation domain that is used when translating validation constraint +error messages. + +strict_email +............ + +.. versionadded:: 2.5 + The ``strict_email`` option was introduced in Symfony 2.5. + +**type**: ``Boolean`` **default**: ``false`` + +If this option is enabled, the `egulias/email-validator`_ library will be +used by the :doc:`/reference/constraints/Email` constraint validator. Otherwise, +the validator uses a simple regular expression to validate email addresses. + +api +... + +.. versionadded:: 2.5 + The ``api`` option was introduced in Symfony 2.5. + +**type**: ``string`` + +Starting with Symfony 2.5, the Validator component introduced a new validation +API. The ``api`` option is used to switch between the different implementations: + +``2.4`` + Use the vaidation API that is compatible with older Symfony versions. + +``2.5`` + Use the validation API introduced in Symfony 2.5. + +``2.5-bc`` or ``auto`` + If you omit a value or set the ``api`` option to ``2.5-bc`` or ``auto``, + Symfony will use an API implementation that is compatible with both the + legacy implementation and the ``2.5`` implementation. You have to use + PHP 5.3.9 or higher to be able to use this implementation. + Full default Configuration -------------------------- @@ -646,3 +716,4 @@ Full default Configuration .. _`protocol-relative`: http://tools.ietf.org/html/rfc3986#section-4.2 .. _`PhpStormOpener`: https://github.com/pinepain/PhpStormOpener +.. _`egulias/email-validator`: https://github.com/egulias/EmailValidator