PHPMentorsValidatorBundle 1.2.0 (stable)
Release Date: 2015-04-27 UTC
What's New in PHPMentorsValidatorBundle 1.2.0
Range constraint
The Range
constraint allows you to use a custom factory to provide the value of min
or max
options as the following:
src/AppBundle/Resources/config/validation.yml
:
AppBundle\Entity\Person:
properties:
...
birthday:
...
- PHPMentors:Range:
max:
service: app.age_range
method: getMinAsDate
maxMessage: ...
min:
service: app.age_range
method: getMaxAsDate
minMessage: ...