public function validateToken($attribute, $params) {
$user = ExtUser::find()->where(['token' => $this->token])->one();
if (!$user) {
$this->addError($attribute, 'TOKEN ERROR');
}
}
public function rules()
{
return [
['token', 'required', 'skipOnError' => true],
['token', 'validateToken', 'skipOnError' => true],
[['name', 'surname', 'email', 'dob', 'type'], 'required', 'skipOnError' => true ],
['email', 'email', 'skipOnError' => true],
];
}