Class MinMaxLength
Responsibility: Validate minimum or maximum characters length in submitted value by configured field minlength
and maxlength
HTML attributes. To measure characters length in submitted value, validator uses multi-byte string function mb_strlen()
.
- MvcCore\Ext\Forms\Validator implements MvcCore\Ext\Forms\IValidator
-
MvcCore\Ext\Forms\Validators\MinMaxLength implements MvcCore\Ext\Forms\Fields\IMinMaxLength uses MvcCore\Ext\Forms\Field\Props\MinMaxLength
Namespace: MvcCore\Ext\Forms\Validators
Located at ext-form-field-text/src/MvcCore/Ext/Forms/Validators/MinMaxLength.php
Located at ext-form-field-text/src/MvcCore/Ext/Forms/Validators/MinMaxLength.php
public
string|null
|
CreateInstance(),
GetErrorMessage(),
SetField(),
SetForm(),
__construct(),
setUpFieldProps(),
throwNewInvalidArgumentException()
|
GetMaxLength(),
GetMinLength(),
SetMaxLength(),
SetMinLength()
|
GetMaxLength(),
GetMinLength(),
SetMaxLength(),
SetMinLength(),
setFormMinMaxLength()
|
integer |
ERROR_MIN_LENGTH
Valid email address error message index. |
#
0
|
integer |
ERROR_MAX_LENGTH
|
#
1
|
protected static
array
|
$errorMessages
Validation failure message template definitions. |
#
[
self::ERROR_MIN_LENGTH => "Field '{0}' requires at least {1} characters.",
self::ERROR_MAX_LENGTH => "Field '{0}' requires no more than {1} characters.",
]
|
protected static
array
|
$fieldSpecificProperties
Field specific values (camel case) and their validator default values. |
#
[
'minLength' => NULL,
'maxLength' => NULL,
]
|
$field,
$form,
$toolClass
|
$maxLength,
$minLength
|