validators\Validator createValidator()

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 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 yii\validators\Validator

The validator

doc_Yii
2016-10-30 17:14:17
Comments
Leave a Comment

Please login to continue.