Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb634bbc

Browse files
committed
wrap lines
1 parent61f8403 commitb634bbc

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

‎reference/forms/types/options/error_mapping.rst.inc

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,29 @@ error_mapping
55

66
This option permitsto modify the default targetof errors.
77

8-
Imagine a custom method named ``matchingCityAndZipCode`` validates whether the cityand zip code matches.
8+
Imagine a custom method named ``matchingCityAndZipCode`` validates
9+
whether the cityand zip code matches.
910
Unfortunately, thereis no"matchingCityAndZipCode" fieldin your form,
1011
soall that Symfony candofor youis display the error on topof the form.
1112

12-
With customized error mapping, you cando better: make the error be mappedto the city field.
13+
With customized error mapping, you cando better:
14+
make the error be mappedto the city field.
1315

14-
Here areto understand the leftand the right sideof the mapping:
16+
Here arethe rulesto understand the leftand the right sideof the mapping:
1517

1618
* The left side containsproperty paths.
17-
*If the violationis generated on apropertyor methodof aclass, its pathis simply propertyName.
18-
*If the violationis generated on an entryof anarrayor ArrayAccessobject, theproperty pathis [indexName].
19-
* You can construct nestedproperty paths by concatenating them, separating properties by dots,
20-
*for example: addresses[work].matchingCityAndZipCode
21-
*The right side contains simply the namesof fieldsin the form.
22-
* The left sideof the error mapping also accepts a dot ., which refersto the field itself.
23-
That means that any error addedto the fieldis addedto the given nested field instead.
19+
*If the violationis generated on apropertyor methodof aclass,
20+
its pathis simply propertyName.
21+
*If the violationis generated on an entryof an ``array``
22+
or ``ArrayAccess``object, theproperty pathis ``[indexName]``.
23+
* You can construct nestedproperty paths by concatenating them,
24+
separating properties by dots,
25+
*for example: ``addresses[work].matchingCityAndZipCode``
26+
* The left sideof the error mapping also accepts a dot ``.``,
27+
which refersto the field itself.
28+
That means that any error addedto the fieldis addedto the given
29+
nested field instead.
30+
* The right side contains simply the namesof fieldsin the form.
31+
32+
.. versionadded::2.1
33+
The ``error_mapping`` optionis newto Symfony2.1.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp