Validate number field with int values in Symfony -
im tryint validate field should contain int value (1, 2, 3....), not decimals.
for i've set in form code:
->add('page', 'number', ['data'=>1])
in validation.yml have configured this:
page: - type: type: digit
i tried digit, int, integer , on, none of them allowed me introduce natural number , pass validation.
use http://symfony.com/doc/current/reference/forms/types/integer.html , http://symfony.com/doc/current/reference/constraints/range.html. set min
range 1 , precision
0 integer validator.
Comments
Post a Comment