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 customized message for a too short string.
  • $tooLong for the customized message for a too long string.
  • $notEqual for the customized message for a string that does not match desired length.
public integer|array $length = null
doc_Yii
2016-10-30 17:14:07
Comments
Leave a Comment

Please login to continue.