PHP Symfony电子邮件表单验证后@

PHP Symfony电子邮件表单验证后@,php,validation,symfony,email,Php,Validation,Symfony,Email,使用我的form builder,我的电子邮件字段设置如下: ->add('email', 'email', (array( 'label' => 'correo electrónico', 'translation_domain' => 'SonataUserBundle', 'attr' => array( 'placehol

使用我的form builder,我的电子邮件字段设置如下:

       ->add('email', 'email', (array(
            'label'              => 'correo electrónico',
            'translation_domain' => 'SonataUserBundle',
            'attr' => array(
                'placeholder' => 'correo electrónico',
            ),
        )))
因此,假设用户在电子邮件字段中输入其值:

test - I get message to include @. Everything is fine here
test@ - it asks me to enter the following part of @. Everything is fine
test@ttt - he thinks this is a valid email and creates a user.
相反,它应该给出一个无效电子邮件的错误。。它应该只接受至少与.com或其他东西。。。是否可以在formbuilder中执行此操作?
我希望尽可能用更少的代码js实现这一点。

EmailType字段是一个文本字段,使用HTML5标记呈现。因此,它仅由浏览器验证。您应该使用

验证此字段。EmailType字段是使用HTML5标记呈现的文本字段。因此,它仅由浏览器验证。您应该使用