Creates a validator object.
public static createValidator ( string | Closure $type, |
||
$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 | the data model to be validated. | |
$attributes | array | string | list of attributes to be validated. This can be either an array of the attribute names or a string of comma-separated attribute names. |
$params | array | initial values to be applied to the validator properties. |
return | the validator |