验证电子邮件不起作用cakephp

时间:2011-05-07 09:53:15

标签: cakephp cakephp-1.3 validation

Class Myprofile extends AppModel{
var $name ='Myprofile';
var $primaryKey = 'myprofileid';


 var $validate = array(
     'name'=> array(
         'rule'=>'notEmpty',
         'message'=>'Please Enter name'
     ),
     'email'=> array(
         'please enter your email'=>array(
             'rule'=>'notEmpty',
             'message'=>'please Enter your email'
         )
     ),
         'email does not correct format' => array(
             'rule'=>array('email','true'),
             'message'=>'email does not correct format'
         ),
         'email'=>array(
             'rule'=>'isUnique',
             'message'=>'the email already taken'
         )          
 );

验证格式电子邮件不起作用 我按照book.cakephp.org进行操作但不起作用 感谢任何建议

1 个答案:

答案 0 :(得分:2)

您可以在重新格式化的代码中看到过早关闭“email”数组。