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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -