Skip to content

Commit 5c00a65

Browse files
committed
Added a tip about atPath() method
1 parent 8b38223 commit 5c00a65

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

reference/forms/types/options/property_path.rst.inc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ property_path
33

44
**type**: ``any`` **default**: ``the field's name``
55

6-
Fields display a property value of the form's domain object by default.
7-
When the form is submitted, the submitted value is written back into the
8-
object.
9-
10-
If you want to override the property that a field reads from and writes
11-
to, you can set the ``property_path`` option. Its default value is the field's
12-
name.
6+
By default form fields read from and write to the properties with the same names
7+
in the form's domain object. The ``property_path`` option lets you define which
8+
property a field reads from and writes to. The value of this option can be any
9+
:doc:`valid PropertyAccess syntax </components/property_access>`.
1310

1411
If you wish the field to be ignored when reading or writing to the object
1512
you can set the ``property_path`` option to ``false``, but using

validation/custom_constraint.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,12 @@ With this, the validator ``validate()`` method gets an object as its first argum
262262
}
263263
}
264264

265+
.. tip::
266+
267+
The ``atPath()`` method defines the property which the validation error is
268+
associated to. Use any :doc:`valid PropertyAccess syntax </components/property_access>`
269+
to define that property.
270+
265271
Note that a class constraint validator is applied to the class itself, and
266272
not to the property:
267273

0 commit comments

Comments
 (0)