validators\StringValidator $message

$message public property User-defined error message used when the value is not a string. public string $message = null

validators\StringValidator $length

$length public property Specifies the length limit of the value to be validated. This can be specified in one of the following forms: an integer: the exact length that the value should be of; an array of one element: the minimum length that the value should be of. For example, [8]. This will overwrite $min. an array of two elements: the minimum and maximum lengths that the value should be of. For example, [8, 128]. This will overwrite both $min and $max. See also: $tooShort for the customi

validators\StringValidator $notEqual

$notEqual public property User-defined error message used when the length of the value is not equal to $length. public string $notEqual = null

validators\StringValidator $max

$max public property Maximum length. If not set, it means no maximum length limit. See also $tooLong for the customized message for a too long string. public integer $max = null

validators\StringValidator $min

$min public property Minimum length. If not set, it means no minimum length limit. See also $tooShort for the customized message for a too short string. public integer $min = null

validators\StringValidator $encoding

$encoding public property The encoding of the string value to be validated (e.g. 'UTF-8'). If this property is not set, yii\base\Application::$charset will be used. public string $encoding = null

validators\SafeValidator validateAttributes()

validateAttributes() public method Validates the specified object. public void validateAttributes ( $model, $attributes = null )$model yii\base\Model The data model being validated $attributes array|null The list of attributes to be validated. Note that if an attribute is not associated with the validator, or is is prefixed with ! char - it will be ignored. If this parameter is null, every attribute listed in $attributes will be validated.

validators\SafeValidator validateAttribute()

validateAttribute() public method Validates a single attribute. Child classes must implement this method to provide the actual validation logic. public void validateAttribute ( $model, $attribute )$model yii\base\Model The data model to be validated $attribute string The name of the attribute to be validated.

validators\RequiredValidator validateValue()

validateValue() protected method Validates a value. A validator class can implement this method to support data validation out of the context of a data model. protected array|null validateValue ( $value )$value mixed The data value to be validated. return array|null The error message and the parameters to be inserted into the error message. Null should be returned if the data is valid. throws yii\base\NotSupportedException if the validator does not supporting data validation withou

validators\RequiredValidator init()

init() public method Initializes the object. This method is invoked at the end of the constructor after the object is initialized with the given configuration. public void init ( )