Property |
Type |
Description |
|
$encoding |
|
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. |
|
$length |
|
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]]. |
|
$max |
|
maximum length. If not set, it means no maximum length limit. |
|
$message |
|
user-defined error message used when the value is not a string. |
|
$min |
|
minimum length. If not set, it means no minimum length limit. |
|
$notEqual |
|
user-defined error message used when the length of the value is not equal to [[length]]. |
|
$tooLong |
|
user-defined error message used when the length of the value is greater than [[max]]. |
|
$tooShort |
|
user-defined error message used when the length of the value is smaller than [[min]]. |
|