Symfony2 - How to validate an email address in a controller
There is an email validator in symfony that can be used in a form: http://symfony.com/doc/current/reference/constraints/Email.html My question is: How can I use this validator in my controlelr in order to validate an email address? This is possible by using the PHP preg_match for usere, but my question is if there is a possibility to use the Symfony already built in email validator. Thank you in advance. By using validateValue method of the Validator service use Symfony\Component\Validator\Constraints\Email as EmailConstraint; // ... public function customAction() { $email = 'value_to_validate