Egulias email validator on Symfony 4

I’m working on a Symfony 4 project and I try to implement RFC email validations on my User’s entity class with annotations using https://github.com/egulias/EmailValidator

My entity:

    /**
     * @ORMColumn(type="string", length=255)
     * @AssertEmail(mode="strict") // I'v also tried strict=true
     *
     */
    private $email;

And I installed egulias package on my project. But I cant get validations working.

I’v also tried this way (validator.yaml):

framework:
    validation:
        email_validation_mode: strict

But I still have a problem.
Do you have any ideas? Thanks a lot!

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *