Class Number
Responsibility: Validate raw user input. Parse float value if possible by Intl
extension or try to determinate floating point automatically and return float
or NULL
.
- MvcCore\Ext\Forms\Validator implements MvcCore\Ext\Forms\IValidator
-
MvcCore\Ext\Forms\Validators\Number implements MvcCore\Ext\Forms\Fields\IMinMaxStepNumbers uses MvcCore\Ext\Forms\Field\Props\MinMaxStepNumbers
Direct known subclasses
MvcCore\Ext\Forms\Validators\FloatNumber, MvcCore\Ext\Forms\Validators\IntNumber, MvcCore\Ext\Forms\Validators\Range
Namespace: MvcCore\Ext\Forms\Validators
Located at ext-form-field-numeric/src/MvcCore/Ext/Forms/Validators/Number.php
Located at ext-form-field-numeric/src/MvcCore/Ext/Forms/Validators/Number.php
public
string|array|null
|
|
protected
Float|null
|
#
parseFloat( string $rawSubmittedValue )
Parse raw user input by automatic floating point number detection. |
CreateInstance(),
GetErrorMessage(),
SetField(),
SetForm(),
__construct(),
setUpFieldProps(),
throwNewInvalidArgumentException()
|
GetMax(),
GetMin(),
GetStep(),
SetMax(),
SetMin(),
SetStep()
|
GetMax(),
GetMin(),
GetStep(),
SetMax(),
SetMin(),
SetStep()
|
integer |
ERROR_NUMBER
Error message index(es). |
#
0
|
integer |
ERROR_GREATER
|
#
1
|
integer |
ERROR_LOWER
|
#
2
|
integer |
ERROR_RANGE
|
#
3
|
integer |
ERROR_DIVISIBLE
|
#
4
|
protected static
array
|
$errorMessages
Validation failure message template definitions. |
#
[
self::ERROR_NUMBER => "Field `{0}` requires a valid number.",
self::ERROR_GREATER => "Field `{0}` requires a value equal or greater than `{1}`.",
self::ERROR_LOWER => "Field `{0}` requires a value equal or lower than `{1}`.",
self::ERROR_RANGE => "Field `{0}` requires a value of `{1}` to `{2}` inclusive.",
self::ERROR_DIVISIBLE => "Field `{0}` requires a divisible value of `{1}`.",
]
|
protected static
array
|
$fieldSpecificProperties
Field specific values (camel case) and their validator default values. |
#
[
'min' => NULL,
'max' => NULL,
'step' => NULL,
]
|
$field,
$form,
$toolClass
|
$max,
$min,
$step
|