0

I'm using symfony 2.7 version. i try to do validate, and it's works fine, just the message for the validate not working. for exmple, email validate:

 /**
 * @Assert\NotBlank()
 *      message = "Email empty";
 * )
 */
/**
 * @ORM\Column(type="string", length=100)
 */
protected $email;

i'm still get the default message: "This value should not be blank." i recreate the Entity file, and Run

php app/console doctrine:generate:entities AppBundle:User

and still the default message. i turn validation: { enable_annotations: true } no any changes. i see the errors, by :

var_dump($errors);

so custuom message not work at all.

thanks

1 Answer 1

1

the message option must be written between the parentheses:

/**
 * @Assert\NotBlank(
 *      message = "Email empty";
 * )
 * @ORM\Column(type="string", length=100)
 */
protected $email;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.