Class Validator
Responsibility: Base validator class with base methods implementations. This class is not possible to instantiate, you need to extend this class and define custom validation rules.
- MvcCore\Ext\Forms\Validator implements MvcCore\Ext\Forms\IValidator
Direct known subclasses
MvcCore\Ext\Forms\Validators\Color, MvcCore\Ext\Forms\Validators\CompanyIdEu, MvcCore\Ext\Forms\Validators\MinMaxLength, MvcCore\Ext\Forms\Validators\Number, MvcCore\Ext\Forms\Validators\Password, MvcCore\Ext\Forms\Validators\Pattern, MvcCore\Ext\Forms\Validators\SafeString, MvcCore\Ext\Forms\Validators\Tel, MvcCore\Ext\Forms\Validators\Url, MvcCore\Ext\Forms\Validators\ValueInOptions, MvcCore\Ext\Forms\Validators\ZipCode, MvcCore\Ext\Forms\Validators\CompanyVatIdEu, MvcCore\Ext\Forms\Validators\CreditCard, MvcCore\Ext\Forms\Validators\Date, MvcCore\Ext\Forms\Validators\Email, MvcCore\Ext\Forms\Validators\Files, MvcCore\Ext\Forms\Validators\Hex, MvcCore\Ext\Forms\Validators\Iban, MvcCore\Ext\Forms\Validators\IpIndirect known subclasses
MvcCore\Ext\Forms\Validators\DateTime, MvcCore\Ext\Forms\Validators\FloatNumber, MvcCore\Ext\Forms\Validators\IntNumber, MvcCore\Ext\Forms\Validators\MinMaxOptions, MvcCore\Ext\Forms\Validators\Month, MvcCore\Ext\Forms\Validators\Range, MvcCore\Ext\Forms\Validators\Time, MvcCore\Ext\Forms\Validators\Week
public static
|
#
CreateInstance( array $constructorConfig = [] )
Create every time new validator instance with configured form instance. No singleton. |
public
|
|
public
|
#
SetForm(
Set up form instance, where is validator created during submit. |
public
|
#
SetField(
Set up field instance, where is validated value by this
validator during submit before every |
public static
string
|
#
GetErrorMessage( integer $errorMsgIndex )
Return predefined validator custom error message strings (not translated) with replacements for field names and more specific info to tell the user what happened or what to do more. |
abstract public
string|array|null
|
#
Validate( string|array $rawSubmittedValue )
Validation method.
Check submitted value by validator specific rules and
if there is any error, call: |
protected
|
#
throwNewInvalidArgumentException( string $errorMsg )
Throw new |
protected
|
#
setUpFieldProps( array $fieldPropsDefaultValidValues = [] )
Set up field specific properties.
If field returns it's specific value ( |
protected
|
$form
Form instance where was validator created. Every validator instance belongs to only one form instance. |
#
NULL
|
protected
|
$field
Currently validated form field instance.
Before every |
#
NULL
|
protected static
string[]
|
$errorMessages
Validator custom error message strings (not translated) with replacements for field names and more specific info to tell the user what happened or what to do more. |
#
[]
|
protected static
array
|
$fieldSpecificProperties
An associative array for extended classes, where you could define in
camel case field specific properties to get before validation into local
context with values from field instance, given in method local |
#
[]
|
protected static
string
|
$toolClass
Remembered value from |
#
''
|