validateData() public static method
Validates the given data with the specified validation rules.
This method will create a DynamicModel instance, populate it with the data to be validated, create the specified validation rules, and then validate the data using these rules.
public static static validateData ( array $data, $rules = [] ) | ||
---|---|---|
$data | array |
The data (name-value pairs) to be validated |
$rules | array |
The validation rules. Please refer to yii\base\Model::rules() on the format of this parameter. |
return | static |
The model instance that contains the data being validated |
throws | yii\base\InvalidConfigException |
if a validation rule is not specified correctly. |
Please login to continue.