base\DynamicModel validateData()

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.

doc_Yii
2016-10-30 16:51:30
Comments
Leave a Comment

Please login to continue.