yii2 动态验证

$model = \yii\base\DynamicModel::validateData($data, [
    [['login_id', 'name'], 'required'],
]);
if ($model->hasErrors()) {

}

此处评论已关闭