Error using Type constrain
Im trying to use @Assert\Type(type="integer") constrain but is not working
as expected. I wrote a string in the desired field, but symfony2 do not
show me any error, it is interpreting this field like 0 (zero) and "jump"
validation. What can i do?
use Symfony\Component\Validator\Constraints as Assert;
class Autor
{
/**
* @Assert\Type(type="integer", message="The value {{ value }} is not
a valid {{ type }}.")
*/
protected $age;
}
No comments:
Post a Comment