简体   繁体   English

Sonata管理员捆绑包电子邮件验证

[英]Sonata admin bundle email validation

What is the best way to add an email validation in Sonata Admin? 在Sonata Admin中添加电子邮件验证的最佳方法是什么?

I saw a discussion in Google groups about it and it says: 我在Google网上论坛上看到了关于它的讨论,它说:

"Why force developers to repeat all validation constraints twice?" “为什么强迫开发人员重复所有验证约束两次?”

https://groups.google.com/forum/?fromgroups=#!topic/sonata-users/xO64f_haMks https://groups.google.com/forum/?fromgroups=#!topic/sonata-users/xO64f_haMks

Is that true? 真的吗? Or is there a way to use the Symfony2 Validation at the same time? 还是有一种可以同时使用Symfony2验证的方法?

Finally it works like this: 最后,它的工作方式如下:

public function configureFormFields(FormMapper $formMapper)
{
    $formMapper
            ->add('email', 'email')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM