Skip to content

Commit 13f97d7

Browse files
committed
Reword
1 parent e94987e commit 13f97d7

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

reference/configuration/framework.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2371,6 +2371,8 @@ enabled
23712371

23722372
**type**: ``boolean`` **default**: ``true`` or ``false`` depending on your installation
23732373

2374+
.. _reference-validation:
2375+
23742376
validation
23752377
~~~~~~~~~~
23762378

validation.rst

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ into a database or passed to a web service.
1111
Symfony provides a `Validator`_ component to handle this for you. This
1212
component is based on the `JSR303 Bean Validation specification`_.
1313

14+
.. index::
15+
pair: Validation; Installation
16+
pair: Validation; Configuration
17+
1418
Installation
1519
------------
1620

@@ -21,6 +25,12 @@ install the validator before using it:
2125
2226
$ composer require symfony/validator doctrine/annotations
2327
28+
.. note::
29+
30+
If your application doesn't use Symfony Flex, you might need to do some
31+
manual configuration to enable validation. Check out the
32+
:ref:`Validation configuration reference <reference-validation>`.
33+
2434
.. index::
2535
single: Validation; The basics
2636

@@ -206,20 +216,6 @@ Inside the template, you can output the list of errors exactly as needed:
206216
Each validation error (called a "constraint violation"), is represented by
207217
a :class:`Symfony\\Component\\Validator\\ConstraintViolation` object.
208218

209-
.. index::
210-
pair: Validation; Configuration
211-
212-
Configuration
213-
-------------
214-
215-
In the previous Symfony versions, enabling the validator in configuration was a requirement. It's not the case anymore, the validation is enabled by default as long as the Validator component is installed. In the same way, annotations are enabled by default if ``doctrine/annotations`` is installed.
216-
217-
.. tip::
218-
219-
When using PHP, YAML, and XML files instead of annotations, Symfony looks
220-
for by default in the ``config/validator/`` directory, but you can configure
221-
other directories with the :ref:`validation.mapping.paths <reference-validation-mapping>` option.
222-
223219
.. index::
224220
single: Validation; Constraints
225221

0 commit comments

Comments
 (0)