From 6ad18f2cd2b3f26b5f169f556464fafac1110dd2 Mon Sep 17 00:00:00 2001 From: Damien Alexandre Date: Tue, 17 Oct 2017 18:54:00 +0200 Subject: [PATCH 1/3] Add GroupSequence validation_groups capability doc --- validation/sequence_provider.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/validation/sequence_provider.rst b/validation/sequence_provider.rst index bcf2f388e86..5786be32d6a 100644 --- a/validation/sequence_provider.rst +++ b/validation/sequence_provider.rst @@ -140,6 +140,24 @@ that group are valid, the second group, ``Strict``, will be validated. sequence, which will contain the ``Default`` group which references the same group sequence, ...). +You can also define a group sequence in the `validation_groups` form option: + +.. code-block:: php + use Symfony\Component\Validator\Constraints\GroupSequence; + use Symfony\Component\Form\AbstractType; + // ... + + class MyType extends AbstractType + { + // ... + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults([ + 'validation_groups' => new GroupSequence(['First', 'Second']), + ]); + } + } + Group Sequence Providers ------------------------ From 39f91434c7f3040d502dd975a7c86c318a185552 Mon Sep 17 00:00:00 2001 From: Damien Alexandre Date: Tue, 17 Oct 2017 18:59:57 +0200 Subject: [PATCH 2/3] Fix code-block --- validation/sequence_provider.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/validation/sequence_provider.rst b/validation/sequence_provider.rst index 5786be32d6a..d39b3989a02 100644 --- a/validation/sequence_provider.rst +++ b/validation/sequence_provider.rst @@ -143,6 +143,7 @@ that group are valid, the second group, ``Strict``, will be validated. You can also define a group sequence in the `validation_groups` form option: .. code-block:: php + use Symfony\Component\Validator\Constraints\GroupSequence; use Symfony\Component\Form\AbstractType; // ... From 9eb4b11b776c448648f1580b4a9631dd1fba099f Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 18 Oct 2017 09:10:24 +0200 Subject: [PATCH 3/3] Minor syntax issues --- validation/sequence_provider.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/validation/sequence_provider.rst b/validation/sequence_provider.rst index d39b3989a02..fec6176d891 100644 --- a/validation/sequence_provider.rst +++ b/validation/sequence_provider.rst @@ -140,9 +140,7 @@ that group are valid, the second group, ``Strict``, will be validated. sequence, which will contain the ``Default`` group which references the same group sequence, ...). -You can also define a group sequence in the `validation_groups` form option: - -.. code-block:: php +You can also define a group sequence in the ``validation_groups`` form option:: use Symfony\Component\Validator\Constraints\GroupSequence; use Symfony\Component\Form\AbstractType;