在模型里这样定义规则
public function rules()
{
return array(
// username and password are required
array(‘username’, ‘required’, ‘message’=>’用户名不能为空’),
array(‘password’, ‘required’, ‘message’=>’密码不能为空’),
array(‘verifyCode’, ‘required’, ‘message’=>’验证码不能为空’),
);
}
比格高
逼格更高