ERREUR SEMANTIQUE SYMFONY

Par SEDI, il y a 4 ans


Bonjour j'ai voulu mettre dans les annnotation un message comme quoi si dans le formulaire register l'adress mail n'est pas valide un message alllait s'afficher

/** * @ORM\Column(type="string", length=180, unique=true) * @Assert\Email(message="The email {{ value }} is not valid.") */ private $email;

VOILA L'ERREUR QUE J'OBTIENS L'ORSQUE JE TESTE SUR LE FORMULAIRE

[Semantical Error] The annotation "@Assert\Email" in property App\Entity\User::$email was never imported. Did you maybe forget to add a "use" statement for this annotation?

QUELQUN PEUT M'EXPLIQUER L'ERREUR ET PEUT M'AIDER A METTRE CE MESSAGE

MERCI

1 réponse

cinquiemeDimension, il y a 4 ans

Salut,

As-tu rajouté ton use Symfony\Component\Validator\Constraints as Assert; au début de ton entité ?