@@ -5,19 +5,29 @@ error_mapping
55
66This 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.
910Unfortunately, thereis no" matchingCityAndZipCode" fieldin your form,
1011soall that Symfony cando for 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 rules to understand the leftand the right sideof the mapping:
1517
1618 * The left side containsproperty paths.
17- *If the violationis generated on aproperty or methodof aclass , its pathis simply propertyName.
18- *If the violationis generated on an entryof anarray or 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 aproperty or 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 .