8000 minor #18593 [Form] Improve form validation section (HeahDude) · symfony/symfony-docs@eb92304 · GitHub
[go: up one dir, main page]

Skip to content

Commit eb92304

Browse files
committed
minor #18593 [Form] Improve form validation section (HeahDude)
This PR was merged into the 5.4 branch. Discussion ---------- [Form] Improve form validation section Commits ------- bb15e89 [Form] Improve form validation section
2 parents 96981a8 + bb15e89 commit eb92304

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

forms.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,8 @@ Before using validation, add support for it in your application:
461461
$ composer require symfony/validator
462462
463463
Validation is done by adding a set of rules, called (validation) constraints,
464-
to a class. You can add them either to the entity class or to the form class.
464+
to a class. You can add them either to the entity class or by using the
465+
:ref:`constraints option <reference-form-option-constraints>` of form types.
465466

466467
To see the first approach - adding constraints to the entity - in action,
467468
add the validation constraints, so that the ``task`` field cannot be empty,
@@ -567,9 +568,9 @@ object.
567568
That's it! If you re-submit the form with invalid data, you'll see the
568569
corresponding errors printed out with the form.
569570

570-
To see the second approach - adding constraints to the form - and to
571-
learn more about the validation constraints, please refer to the
572-
:doc:`Symfony validation documentation </validation>`.
571+
To see the second approach - adding constraints to the form - please refer to
572+
this :ref:`section <form-option-constraints>`.
573+
Both approaches can be used together.
573574

574575
Form Validation Messages
575576
~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)
0