@@ -6,7 +6,9 @@ Countable) element count is *between* some minimum and maximum value.
66
77========== ===================================================================
88Applies to :ref: `property or method <validation-property-target >`
9- Options - `exactMessage `_
9+ Options - `divisibleBy `_
10+ - `divisibleByMessage `_
11+ - `exactMessage `_
1012 - `groups `_
1113 - `max `_
1214 - `maxMessage `_
@@ -101,6 +103,44 @@ you might add the following:
101103 Options
102104-------
103105
106+ divisibleBy
107+ ~~~~~~~~~~~
108+
109+ **type **: ``integer `` **default **: null
110+
111+ .. versionadded :: 5.1
112+
113+ The ``divisibleBy `` option was introduced in Symfony 5.1.
114+
115+ Validates that the number of elements of the given collection is divisible by
116+ a certain number.
117+
118+ .. seealso ::
119+
120+ If you need to validate that other types of data different from collections
121+ are divisible by a certain number, use the
122+ :doc: `DivisibleBy </reference/constraints/DivisibleBy >` constraint.
123+
124+ divisibleByMessage
125+ ~~~~~~~~~~~~~~~~~~
126+
127+ **type **: ``string `` **default **: ``The number of elements in this collection should be a multiple of {{ compared_value }}. ``
128+
129+ .. versionadded :: 5.1
130+
131+ The ``divisibleByMessage `` option was introduced in Symfony 5.1.
132+
133+ The message that will be shown if the number of elements of the given collection
134+ is not divisible by the number defined in the ``divisibleBy `` option.
135+
136+ You can use the following parameters in this message:
137+
138+ ======================== ===================================================
139+ Parameter Description
140+ ======================== ===================================================
141+ ``{{ compared_value }} `` The number configured in the ``divisibleBy `` option
142+ ======================== ===================================================
143+
104144exactMessage
105145~~~~~~~~~~~~
106146
0 commit comments