2015-01-30 09:40:06 +01:00
|
|
|
# Between
|
|
|
|
|
2018-02-27 09:04:23 +01:00
|
|
|
- `Between(mixed $minimum, mixed $maximum)`
|
2015-01-30 09:40:06 +01:00
|
|
|
|
2018-02-27 09:04:23 +01:00
|
|
|
Validates whether the input is between two other values.
|
2015-01-30 09:40:06 +01:00
|
|
|
|
|
|
|
```php
|
2018-05-31 15:04:28 +02:00
|
|
|
v::intVal()->between(10, 20)->validate(10); // true
|
2015-10-20 02:53:25 +02:00
|
|
|
v::intVal()->between(10, 20)->validate(15); // true
|
2018-05-31 15:04:28 +02:00
|
|
|
v::intVal()->between(10, 20)->validate(20); // true
|
2015-01-30 09:40:06 +01:00
|
|
|
```
|
|
|
|
|
2019-05-11 18:32:13 +02:00
|
|
|
Validation makes comparison easier, check out our supported
|
2024-02-19 11:23:29 +01:00
|
|
|
[comparable values](../07-comparable-values.md).
|
2015-01-30 09:40:06 +01:00
|
|
|
|
|
|
|
Message template for this validator includes `{{minValue}}` and `{{maxValue}}`.
|
|
|
|
|
2019-05-11 18:32:13 +02:00
|
|
|
## Categorization
|
|
|
|
|
|
|
|
- Comparisons
|
|
|
|
|
2017-03-27 22:04:13 +02:00
|
|
|
## Changelog
|
|
|
|
|
|
|
|
Version | Description
|
|
|
|
--------|-------------
|
2018-05-31 15:04:28 +02:00
|
|
|
2.0.0 | Became always inclusive
|
2017-03-27 22:04:13 +02:00
|
|
|
1.0.0 | Became inclusive by default
|
|
|
|
0.3.9 | Created
|
|
|
|
|
2015-08-20 06:38:41 +02:00
|
|
|
***
|
2015-01-30 09:40:06 +01:00
|
|
|
See also:
|
|
|
|
|
2018-12-11 13:31:50 +01:00
|
|
|
- [DateTime](DateTime.md)
|
2018-05-31 15:04:28 +02:00
|
|
|
- [GreaterThan](GreaterThan.md)
|
2017-03-28 11:53:14 +02:00
|
|
|
- [Length](Length.md)
|
2018-05-31 15:04:28 +02:00
|
|
|
- [LessThan](LessThan.md)
|
2017-03-28 11:53:14 +02:00
|
|
|
- [Max](Max.md)
|
2018-05-31 15:04:28 +02:00
|
|
|
- [Min](Min.md)
|