Skip to content

Commit 388cc7d

Browse files
committed
minor symfony#8981 update forms.rst (guquinteros, javiereguiluz)
This PR was merged into the 4.0 branch. Discussion ---------- update forms.rst add validator Commits ------- fa24874 Reword 04fd97b update forms.rst
2 parents 8cfaffc + fa24874 commit 388cc7d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

forms.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,12 @@ valid, but whether or not the ``$task`` object is valid after the form has
317317
applied the submitted data to it. Calling ``$form->isValid()`` is a shortcut
318318
that asks the ``$task`` object whether or not it has valid data.
319319

320+
Before using validation, add support for it in your application:
321+
322+
.. code-block:: terminal
323+
324+
$ composer require validator
325+
320326
Validation is done by adding a set of rules (called constraints) to a class. To
321327
see this in action, add validation constraints so that the ``task`` field cannot
322328
be empty and the ``dueDate`` field cannot be empty and must be a valid \DateTime

0 commit comments

Comments
 (0)