respect-validation/docs/Min.md

30 lines
582 B
Markdown
Raw Normal View History

2015-01-30 09:40:06 +01:00
# Min
- `Min(mixed $minValue)`
- `Min(mixed $minValue, bool $inclusive)`
2015-01-30 09:40:06 +01:00
Validates if the input is greater than the minimum value.
```php
v::intVal()->min(15)->validate(5); // false
v::intVal()->min(5)->validate(5); // false
v::intVal()->min(5, true)->validate(5); // true
2015-01-30 09:40:06 +01:00
```
Also accepts dates:
```php
v::date()->min('2012-01-01')->validate('2015-01-01'); // true
2015-01-30 09:40:06 +01:00
```
`true` may be passed as a parameter to indicate that inclusive
values must be used.
Message template for this validator includes `{{minValue}}`.
***
2015-01-30 09:40:06 +01:00
See also:
* [Max](Max.md)
* [Between](Between.md)