@@ -56,8 +56,7 @@ you might add the following:
56
56
- Range :
57
57
min : 120
58
58
max : 180
59
- minMessage : You must be at least {{ limit }}cm tall to enter
60
- maxMessage : You cannot be taller than {{ limit }}cm to enter
59
+ notInRangeMessage : You must be between {{ min }}cm and {{ max }}cm tall to enter
61
60
62
61
.. code-block :: xml
63
62
@@ -72,8 +71,7 @@ you might add the following:
72
71
<constraint name =" Range" >
73
72
<option name =" min" >120</option >
74
73
<option name =" max" >180</option >
75
- <option name =" minMessage" >You must be at least {{ limit }}cm tall to enter</option >
76
- <option name =" maxMessage" >You cannot be taller than {{ limit }}cm to enter</option >
74
+ <option name =" notInRangeMessage" >You must be between {{ min }}cm and {{ max }}cm tall to enter</option >
77
75
</constraint >
78
76
</property >
79
77
</class >
@@ -94,8 +92,7 @@ you might add the following:
94
92
$metadata->addPropertyConstraint('height', new Assert\Range([
95
93
'min' => 120,
96
94
'max' => 180,
97
- 'minMessage' => 'You must be at least {{ limit }}cm tall to enter',
98
- 'maxMessage' => 'You cannot be taller than {{ limit }}cm to enter',
95
+ 'notInRangeMessage' => 'You must be between {{ min }}cm and {{ max }}cm tall to enter',
99
96
]));
100
97
}
101
98
}
@@ -350,7 +347,8 @@ maxMessage
350
347
**type **: ``string `` **default **: ``This value should be {{ limit }} or less. ``
351
348
352
349
The message that will be shown if the underlying value is more than the
353
- `max `_ option.
350
+ `max `_ option, and no `min `_ option has been defined (if both are defined, use
351
+ `notInRangeMessage `_).
354
352
355
353
You can use the following parameters in this message:
356
354
@@ -393,7 +391,8 @@ minMessage
393
391
**type **: ``string `` **default **: ``This value should be {{ limit }} or more. ``
394
392
395
393
The message that will be shown if the underlying value is less than the
396
- `min `_ option.
394
+ `min `_ option, and no `max `_ option has been defined (if both are defined, use
395
+ `notInRangeMessage `_).
397
396
398
397
You can use the following parameters in this message:
399
398
0 commit comments