Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f979cd1

Browse files
committed
minor #20163 [Validator] Add errorPath to Unique constraint (thibaut22200)
This PR was squashed before being merged into the 7.2 branch. Discussion ---------- [Validator] Add errorPath to Unique constraint Document symfony/symfony#57436 and closes #19976 Commits ------- 23838fd [Validator] Add errorPath to Unique constraint
2 parents a9bf6c6 + 23838fd commit f979cd1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

reference/constraints/Unique.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ collection::
170170
171171
.. include:: /reference/constraints/_groups-option.rst.inc
172172

173+
``errorPath``
174+
~~~~~~~~~~~~~
175+
176+
**type**: ``string`` **default**: ``null``
177+
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"``
181+
173182
``message``
174183
~~~~~~~~~~~
175184

0 commit comments

Comments
 (0)