@@ -5,25 +5,25 @@ This constraint is used to ensure that the given value is one of a given
5
5
set of *valid * choices. It can also be used to validate that each item in
6
6
an array of items is one of those valid choices.
7
7
8
- +----------------+----------------------------------------------------------------------- +
9
- | Applies to | :ref: `property or method <validation-property-target >` |
10
- +----------------+----------------------------------------------------------------------- +
11
- | Options | - `choices `_ |
12
- | | - `callback `_ |
13
- | | - `multiple `_ |
14
- | | - `min `_ |
15
- | | - `max `_ |
16
- | | - `message `_ |
17
- | | - `multipleMessage `_ |
18
- | | - `minMessage `_ |
19
- | | - `maxMessage `_ |
20
- | | - `strict `_ |
21
- | | - `payload `_ |
22
- +----------------+----------------------------------------------------------------------- +
23
- | Class | :class: `Symfony\\ Component\\ Validator\\ Constraints\\ Choice ` |
24
- +----------------+----------------------------------------------------------------------- +
25
- | Validator | :class: `Symfony\\ Component\\ Validator\\ Constraints\\ ChoiceValidator ` |
26
- +----------------+----------------------------------------------------------------------- +
8
+ +----------------+----------------------------------------------------------------------+
9
+ | Applies to | :ref: `property or method <validation-property-target >` |
10
+ +----------------+----------------------------------------------------------------------+
11
+ | Options | - `choices `_ |
12
+ | | - `callback `_ |
13
+ | | - `multiple `_ |
14
+ | | - `min `_ |
15
+ | | - `max `_ |
16
+ | | - `message `_ |
17
+ | | - `multipleMessage `_ |
18
+ | | - `minMessage `_ |
19
+ | | - `maxMessage `_ |
20
+ | | - `strict `_ |
21
+ | | - `payload `_ |
22
+ +----------------+----------------------------------------------------------------------+
23
+ | Class | :class: `Symfony\\ Component\\ Validator\\ Constraints\\ Choice ` |
24
+ +----------------+----------------------------------------------------------------------+
25
+ | Validator | :class: `Symfony\\ Component\\ Validator\\ Constraints\\ ChoiceValidator ` |
26
+ +----------------+----------------------------------------------------------------------+
27
27
28
28
Basic Usage
29
29
-----------
@@ -276,8 +276,8 @@ callback
276
276
**type **: ``string|array|Closure ``
277
277
278
278
This is a callback method that can be used instead of the `choices `_ option
279
- to return the choices array. See ` Supplying the Choices with a Callback Function `_
280
- for details on its usage.
279
+ to return the choices array. See
280
+ ` Supplying the Choices with a Callback Function `_ for details on its usage.
281
281
282
282
multiple
283
283
~~~~~~~~
@@ -314,16 +314,17 @@ message
314
314
315
315
**type **: ``string `` **default **: ``The value you selected is not a valid choice. ``
316
316
317
- This is the message that you will receive if the ``multiple `` option is set
318
- to ``false ``, and the underlying value is not in the valid array of choices.
317
+ This is the message that you will receive if the ``multiple `` option is
318
+ set to ``false `` and the underlying value is not in the valid array of
319
+ choices.
319
320
320
321
multipleMessage
321
322
~~~~~~~~~~~~~~~
322
323
323
324
**type **: ``string `` **default **: ``One or more of the given values is invalid. ``
324
325
325
- This is the message that you will receive if the ``multiple `` option is set
326
- to ``true ``, and one of the values on the underlying array being checked
326
+ This is the message that you will receive if the ``multiple `` option is
327
+ set to ``true `` and one of the values on the underlying array being checked
327
328
is not in the array of valid choices.
328
329
329
330
minMessage
@@ -348,7 +349,7 @@ strict
348
349
**type **: ``Boolean `` **default **: ``false ``
349
350
350
351
If true, the validator will also check the type of the input value. Specifically,
351
- this value is passed to as the third argument to the PHP :phpfunction: `in_array ` method
352
- when checking to see if a value is in the valid choices array.
352
+ this value is passed to as the third argument to the PHP :phpfunction: `in_array `
353
+ method when checking to see if a value is in the valid choices array.
353
354
354
355
.. include :: /reference/constraints/_payload-option.rst.inc
0 commit comments