createValidator() public static method
Creates a validator object.
public static yii\validators\Validator createValidator ( $type, $model, $attributes, $params = [] )$type
string|Closure
The validator type. This can be either: a built-in validator name listed in $builtInValidators; a method name of the model class; an anonymous function; a validator class name. $model yii\base\Model
The data model to be validated. $attributes
array|string
List of attributes to be validated. This