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/
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…