Skip to content

[Validator] Documented the "compared_value_path" placeholder #11710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2019
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
[Validator] Documented the "compared_value_path" placeholder
  • Loading branch information
javiereguiluz committed Jun 10, 2019
commit e4880b67b5b59a9d2d16f554c60117f7a7c1370f
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.