Skip to content

Commit a1b60ec

Browse files
committed
[symfony#2647] Minor tweaks to new validation group sequence docs
1 parent 5676172 commit a1b60ec

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

book/validation.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ With this configuration, there are two validation groups:
772772
* ``Default`` - contains the constraints not assigned to any other group;
773773

774774
* ``User`` - contains the constraints that belongs to group ``Default``
775-
(this group is usefull for :ref:`book-validation-group-sequence`);
775+
(this group is useful for :ref:`book-validation-group-sequence`);
776776

777777
* ``registration`` - contains the constraints on the ``email`` and ``password``
778778
fields only.
@@ -798,14 +798,16 @@ Group Sequence
798798
--------------
799799

800800
In some cases, you want to validate your groups by steps. To do this, you can
801-
use the ``GroupSequence`` feature. In the case an object defines a group sequence,
802-
the groups in the group sequence will be validated in order.
801+
use the ``GroupSequence`` feature. In the case, an object defines a group sequence,
802+
and then the groups in the group sequence are validated in order.
803803

804-
Group sequences cannot contain the group ``Default``, this would create a
805-
cycle, but need to contain the group ``{ClassName}`` instead.
804+
.. tip::
805+
806+
Group sequences cannot contain the group ``Default``, as this would create
807+
a loop. Instead, use the group ``{ClassName}`` (e.g. ``User``) instead.
806808

807809
For example, suppose you have a ``User`` class and want to validate that the
808-
username and the password are different only if all other validations passes
810+
username and the password are different only if all other validation passes
809811
(in order to avoid multiple error messages).
810812

811813
.. configuration-block::
@@ -908,9 +910,9 @@ username and the password are different only if all other validations passes
908910
}
909911
}
910912
911-
In this example, it will first validate all constraints in group ``User``
912-
(eg. ``Default``). Only if all constraints in that group are valid, the second
913-
group, ``Strict``, will be validated.
913+
In this example, it will first validate all constraints in the group ``User``
914+
(which is the same as the ``Default`` group). Only if all constraints in
915+
that group are valid, the second group, ``Strict``, will be validated.
914916

915917
.. _book-validation-raw-values:
916918

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy