Skip to content

Commit d7c9c68

Browse files
committed
minor symfony#11953 [Validator] Document the new notInRangeMessage option (Lctrs)
This PR was merged into the 4.4 branch. Discussion ---------- [Validator] Document the new notInRangeMessage option Ref. PR : symfony/symfony#32435 Close symfony#11952 Commits ------- 61641ca [Validator] Document the new notInRangeMessage option
2 parents 19c7401 + 61641ca commit d7c9c68

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

reference/constraints/Range.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Options - `groups`_
1313
- `min`_
1414
- `minMessage`_
1515
- `minPropertyPath`_
16+
- `notInRangeMessage`_
1617
- `payload`_
1718
Class :class:`Symfony\\Component\\Validator\\Constraints\\Range`
1819
Validator :class:`Symfony\\Component\\Validator\\Constraints\\RangeValidator`
@@ -433,3 +434,25 @@ with regard to the ``$startDate`` property of the same object, use
433434

434435
.. _`is_numeric`: https://php.net/manual/en/function.is-numeric.php
435436
.. _`accepted by the DateTime constructor`: https://php.net/manual/en/datetime.formats.php
437+
438+
notInRangeMessage
439+
~~~~~~~~~~~~~~~~~
440+
441+
**type**: ``string`` **default**: ``This value should be between {{ min }} and {{ max }}.``
442+
443+
.. versionadded:: 4.4
444+
445+
The ``notInRangeMessage`` option was introduced in Symfony 4.4.
446+
447+
The message that will be shown if the underlying value is less than the
448+
`min`_ option and more than the `max`_ option.
449+
450+
You can use the following parameters in this message:
451+
452+
=============== ==============================================================
453+
Parameter Description
454+
=============== ==============================================================
455+
``{{ max }}`` The upper limit
456+
``{{ min }}`` The lower limit
457+
``{{ value }}`` The current (invalid) value
458+
=============== ==============================================================

0 commit comments

Comments
 (0)