@@ -9,8 +9,10 @@ Options - `groups`_
99 - `invalidMessage `_
1010 - `max `_
1111 - `maxMessage `_
12+ - `maxPropertyPath `_
1213 - `min `_
1314 - `minMessage `_
15+ - `minPropertyPath `_
1416 - `payload `_
1517Class :class: `Symfony\\ Component\\ Validator\\ Constraints\\ Range `
1618Validator :class: `Symfony\\ Component\\ Validator\\ Constraints\\ RangeValidator `
@@ -358,6 +360,28 @@ Parameter Description
358360``{{ value }} `` The current (invalid) value
359361=============== ==============================================================
360362
363+ maxPropertyPath
364+ ~~~~~~~~~~~~~~~
365+
366+ **type **: ``string ``
367+
368+ .. versionadded :: 4.4
369+
370+ The ``maxPropertyPath `` option was introduced in Symfony 4.4.
371+
372+ It defines the object property whose value is used as ``max `` option.
373+
374+ For example, if you want to compare the ``$submittedDate `` property of some object
375+ with regard to the ``$deadline `` property of the same object, use
376+ ``maxPropertyPath="deadline" `` in the range constraint of ``$submittedDate ``.
377+
378+ .. tip ::
379+
380+ When using this option, its value is available in error messages as the
381+ ``{{ max_limit_path }} `` placeholder. Although it's not intended to
382+ include it in the error messages displayed to end users, it's useful when
383+ using APIs for doing any mapping logic on client-side.
384+
361385min
362386~~~
363387
@@ -383,6 +407,28 @@ Parameter Description
383407``{{ value }} `` The current (invalid) value
384408=============== ==============================================================
385409
410+ minPropertyPath
411+ ~~~~~~~~~~~~~~~
412+
413+ **type **: ``string ``
414+
415+ .. versionadded :: 4.4
416+
417+ The ``minPropertyPath `` option was introduced in Symfony 4.4.
418+
419+ It defines the object property whose value is used as ``min `` option.
420+
421+ For example, if you want to compare the ``$endDate `` property of some object
422+ with regard to the ``$startDate `` property of the same object, use
423+ ``minPropertyPath="startDate" `` in the range constraint of ``$endDate ``.
424+
425+ .. tip ::
426+
427+ When using this option, its value is available in error messages as the
428+ ``{{ min_limit_path }} `` placeholder. Although it's not intended to
429+ include it in the error messages displayed to end users, it's useful when
430+ using APIs for doing any mapping logic on client-side.
431+
386432.. include :: /reference/constraints/_payload-option.rst.inc
387433
388434.. _`is_numeric` : https://php.net/manual/en/function.is-numeric.php
0 commit comments