@@ -460,14 +460,11 @@ Before using validation, add support for it in your application:
460
460
$ composer require symfony/validator
461
461
462
462
Validation is done by adding a set of rules, called (validation) constraints,
463
- to a class.
463
+ to a class. You can add them either to the entity class or to the form class.
464
464
465
- There are two approaches - you can either add the constraints to the entity,
466
- or you can add the constraints to the form.
467
-
468
- To see the first approach - adding constraints to the entity - in action,
465
+ To see the first approach - adding constraints to the entity - in action,
469
466
add the validation constraints, so that the ``task `` field cannot be empty,
470
- and the ``dueDate `` field cannot be empty, and must be a valid \ D ateTime
467
+ and the ``dueDate `` field cannot be empty, and must be a valid `` DateTime ``
471
468
object.
472
469
473
470
.. configuration-block ::
@@ -550,9 +547,9 @@ object.
550
547
}
551
548
552
549
That's it! If you re-submit the form with invalid data, you'll see the
553
- corresponding errors printed out with the form.
550
+ corresponding errors printed out with the form.
554
551
555
- To see the second approach - adding constraints to the form and to
552
+ To see the second approach - adding constraints to the form - and to
556
553
learn more about the validation constraints, please refer to the
557
554
:doc: `Symfony validation documentation </validation >`.
558
555
0 commit comments