Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions reference/constraints/_comparison-propertypath-option.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,14 @@ It defines the object property whose value is used to make the comparison.
For example, if you want to compare the ``$endDate`` property of some object
with regard to the ``$startDate`` property of the same object, use
``propertyPath="startDate"`` in the comparison constraint of ``$endDate``.

.. tip::

When using this option, its value is available in error messages as the
``{{ compared_value_path }}`` placeholder. Although it's not intended to
include it in the error messages displayed to end users, it's useful when
using APIs for doing any mapping logic on client-side.

.. versionadded:: 4.4

The ``{{ compared_value_path }}`` placeholder was introduced in Symfony 4.4.