@ -10,7 +10,7 @@
$inputDate=[
"name" => "kuangweijian",
"email" => "12345678@qq.com",
"hkPhoneNum"=> "012345678",
"hkPhoneNum"=> "",
"password" => "1234567890",
"pwdConfirm"=> "1234567890",
];
@ -28,6 +28,17 @@ use yii\validators\Validator;
}
/**
* {@inheritdoc}
*/
public function validateAttribute($model, $attribute)
{
$result = $this->validateValue($model->$attribute);
if (!empty($result)) {
$this->addError($model, $attribute, $result[0], $result[1]);
@ -42,5 +53,6 @@ use yii\validators\Validator;
return $valid ? null : [$this->message, []];
?>