How to validate email using Yii Model validation rules function code. Also how to check email exist or not using Model validation rules function in Yii.
You can set your model validations as below
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
//First parameter is your field name of table which has email value
array('email', 'email','message'=>"The email isn't correct"),
array('email', 'unique','message'=>'Email already exists!'),
);
}
Yii Reference Link For More Detail: http://www.yiiframework.com/wiki/56/