@@ -9,8 +9,10 @@ Options - `groups`_
9
9
- `invalidMessage `_
10
10
- `max `_
11
11
- `maxMessage `_
12
+ - `maxPropertyPath `_
12
13
- `min `_
13
14
- `minMessage `_
15
+ - `minPropertyPath `_
14
16
- `payload `_
15
17
Class :class: `Symfony\\ Component\\ Validator\\ Constraints\\ Range `
16
18
Validator :class: `Symfony\\ Component\\ Validator\\ Constraints\\ RangeValidator `
@@ -358,6 +360,28 @@ Parameter Description
358
360
``{{ value }} `` The current (invalid) value
359
361
=============== ==============================================================
360
362
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
+
361
385
min
362
386
~~~
363
387
@@ -383,6 +407,28 @@ Parameter Description
383
407
``{{ value }} `` The current (invalid) value
384
408
=============== ==============================================================
385
409
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
+
386
432
.. include :: /reference/constraints/_payload-option.rst.inc
387
433
388
434
.. _`is_numeric` : https://php.net/manual/en/function.is-numeric.php
0 commit comments