File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -175,9 +175,16 @@ collection::
175175
176176**type **: ``string `` **default **: ``null ``
177177
178- This option allows you to define a custom path for your message.
179- ``#[Assert\Unique(fields: ['latitude', 'longitude'], errorPath: 'point_of_interest')] ``
180- Instead of ``0: "Error message" ``, it will be : ``0.point_of_interest: "Error message" ``
178+ .. versionadded :: 7.2
179+
180+ The ``errorPath `` option was introduced in Symfony 7.2.
181+
182+ If a validation error occurs, the error message is, by default, bound to the
183+ first element in the collection. Use this option to bind the error message to a
184+ specific field within the first item of the collection.
185+
186+ The value of this option must use any :doc: `valid PropertyAccess syntax </components/property_access >`
187+ (e.g. ``'point_of_interest' ``, ``'user.email' ``).
181188
182189``message ``
183190~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments