From 04fd97b70255f8ed382cfd46920cb0832e7c0b43 Mon Sep 17 00:00:00 2001 From: Guillermo Quinteros Date: Thu, 4 Jan 2018 17:45:45 -0300 Subject: [PATCH 1/2] update forms.rst add validator --- forms.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/forms.rst b/forms.rst index 22be65c152d..cf3e09c942c 100644 --- a/forms.rst +++ b/forms.rst @@ -322,6 +322,16 @@ see this in action, add validation constraints so that the ``task`` field cannot be empty and the ``dueDate`` field cannot be empty and must be a valid \DateTime object. +Installation +------------ + +In applications using :doc:`Symfony Flex `, run this command to +install the validator feature before using it: + +.. code-block:: terminal + + $ composer require validator + .. configuration-block:: .. code-block:: php-annotations From fa24874ae6af0a509605d64e58f854b21102d9e9 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 5 Jan 2018 10:29:42 +0100 Subject: [PATCH 2/2] Reword --- forms.rst | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/forms.rst b/forms.rst index cf3e09c942c..9bc04933f85 100644 --- a/forms.rst +++ b/forms.rst @@ -317,21 +317,17 @@ valid, but whether or not the ``$task`` object is valid after the form has applied the submitted data to it. Calling ``$form->isValid()`` is a shortcut that asks the ``$task`` object whether or not it has valid data. -Validation is done by adding a set of rules (called constraints) to a class. To -see this in action, add validation constraints so that the ``task`` field cannot -be empty and the ``dueDate`` field cannot be empty and must be a valid \DateTime -object. - -Installation ------------- - -In applications using :doc:`Symfony Flex `, run this command to -install the validator feature before using it: +Before using validation, add support for it in your application: .. code-block:: terminal $ composer require validator +Validation is done by adding a set of rules (called constraints) to a class. To +see this in action, add validation constraints so that the ``task`` field cannot +be empty and the ``dueDate`` field cannot be empty and must be a valid \DateTime +object. + .. configuration-block:: .. code-block:: php-annotations