Class Number
Responsibility: init, pre-dispatch and render <input>
HTML element with types number
and type range
in extended class. Number
field and it's extended fields have their own validator(s) to parse and check submitted value by min/max/step/pattern. This field always return parsed float
or NULL
.
-
MvcCore\Ext\Forms\Field
implements
MvcCore\Ext\Forms\IField
uses
MvcCore\Ext\Forms\Field\Props,
MvcCore\Ext\Forms\Field\Getters,
MvcCore\Ext\Forms\Field\Setters,
MvcCore\Ext\Forms\Field\Rendering
-
MvcCore\Ext\Forms\Fields\Number
implements
MvcCore\Ext\Forms\Fields\IVisibleField,
MvcCore\Ext\Forms\Fields\ILabel,
MvcCore\Ext\Forms\Fields\IMinMaxStepNumbers,
MvcCore\Ext\Forms\Fields\IDataList
uses
MvcCore\Ext\Forms\Field\Props\VisibleField,
MvcCore\Ext\Forms\Field\Props\Label,
MvcCore\Ext\Forms\Field\Props\MinMaxStepNumbers,
MvcCore\Ext\Forms\Field\Props\DataList,
MvcCore\Ext\Forms\Field\Props\AutoComplete,
MvcCore\Ext\Forms\Field\Props\PlaceHolder,
MvcCore\Ext\Forms\Field\Props\Wrapper,
MvcCore\Ext\Forms\Field\Props\InputMode
Methods summary
public
float|null
|
#
GetValue( )
Get numeric field value as float .
Get numeric field value as float .
Returns
float|null
Overrides
|
public
MvcCore\Ext\Forms\Validators\Number
|
#
SetValue( float|null $value )
Set numeric field value as float .
Set numeric field value as float .
Parameters
Returns
Overrides
|
public
MvcCore\Ext\Forms\Fields\Number
|
#
SetForm( MvcCore\Ext\IForm $form )
This INTERNAL method is called from \MvcCore\Ext\Form after field
is added into form instance by $form->AddField(); method. Do not
use this method even if you don't develop any form field.
- Check if field has any name, which is required.
- Set up form and field id attribute by form id and field name.
- Set up required.
- Set up translate boolean property.
- Set up pattern validator automatically if any pattern property defined.
This INTERNAL method is called from \MvcCore\Ext\Form after field
is added into form instance by $form->AddField(); method. Do not
use this method even if you don't develop any form field.
- Check if field has any name, which is required.
- Set up form and field id attribute by form id and field name.
- Set up required.
- Set up translate boolean property.
- Set up pattern validator automatically if any pattern property defined.
Parameters
Returns
Throws
InvalidArgumentException
Overrides
|
public
array
&
|
#
GetValidatorData( array $fieldPropsDefaultValidValues = [] )
Return field specific data for validator.
Return field specific data for validator.
Parameters
- $fieldPropsDefaultValidValues
Returns
array
Overrides
|
public
|
#
PreDispatch( )
This INTERNAL method is called from \MvcCore\Ext\Form just before
field is naturally rendered. It sets up field for rendering process.
Do not use this method even if you don't develop any form field.
- Set up field render mode if not defined.
- Translate label text if necessary.
- Set up inputmode field attribute if necessary.
- Set up tab-index if necessary.
This INTERNAL method is called from \MvcCore\Ext\Form just before
field is naturally rendered. It sets up field for rendering process.
Do not use this method even if you don't develop any form field.
- Set up field render mode if not defined.
- Translate label text if necessary.
- Set up inputmode field attribute if necessary.
- Set up tab-index if necessary.
Overrides
|
public
string
|
#
RenderControl( )
This INTERNAL method is called from \MvcCore\Ext\Forms\Field\Rendering
in rendering process. Do not use this method even if you don't develop any form field.
This INTERNAL method is called from \MvcCore\Ext\Forms\Field\Rendering
in rendering process. Do not use this method even if you don't develop any form field.
Render control tag only without label or specific errors.
Returns
string
Overrides
|
Methods inherited from MvcCore\Ext\Forms\IField
AddControlAttrs(),
AddCssClasses(),
AddError(),
AddValidators(),
GetControlAttr(),
GetControlAttrs(),
GetCssClasses(),
GetCssSupportingFile(),
GetId(),
GetJsClassName(),
GetJsSupportingFile(),
GetName(),
GetTemplates(),
GetTitle(),
GetType(),
GetValidators(),
GetViewScript(),
HasValidator(),
RemoveValidator(),
Render(),
RenderControlInsideLabel(),
RenderErrors(),
RenderLabel(),
RenderLabelAndControl(),
RenderNaturally(),
RenderTemplate(),
SetControlAttr(),
SetControlAttrs(),
SetCssClasses(),
SetCssSupportingFile(),
SetId(),
SetJsClassName(),
SetJsSupportingFile(),
SetName(),
SetTemplate(),
SetTemplates(),
SetTitle(),
SetTranslate(),
SetType(),
SetValidators(),
SetViewScript()
|
Methods inherited from MvcCore\Ext\Forms\Fields\IVisibleField
GetAccessKey(),
GetAutoFocus(),
GetDisabled(),
GetReadOnly(),
GetRequired(),
GetTabIndex(),
SetAccessKey(),
SetAutoFocus(),
SetDisabled(),
SetReadOnly(),
SetRequired(),
SetTabIndex()
|
Methods inherited from MvcCore\Ext\Forms\Fields\ILabel
AddLabelAttrs(),
GetLabel(),
GetLabelAttr(),
GetLabelAttrs(),
GetLabelSide(),
GetRenderMode(),
SetLabel(),
SetLabelAttr(),
SetLabelAttrs(),
SetLabelSide(),
SetRenderMode()
|
Methods used from MvcCore\Ext\Forms\Field\Props\Label
AddLabelAttrs(),
GetLabel(),
GetLabelAttr(),
GetLabelAttrs(),
GetLabelSide(),
GetRenderMode(),
SetLabel(),
SetLabelAttr(),
SetLabelAttrs(),
SetLabelSide(),
SetRenderMode()
|
Methods used from MvcCore\Ext\Forms\Field\Getters
GetControlAttr(),
GetControlAttrs(),
GetCssClasses(),
GetCssSupportingFile(),
GetId(),
GetJsClassName(),
GetJsSupportingFile(),
GetName(),
GetTemplates(),
GetTitle(),
GetTranslate(),
GetType(),
GetValidators(),
GetViewScript(),
HasValidator()
|
Methods used from MvcCore\Ext\Forms\Field\Setters
AddControlAttrs(),
AddCssClasses(),
AddError(),
AddValidators(),
RemoveValidator(),
SetControlAttr(),
SetControlAttrs(),
SetCssClasses(),
SetCssSupportingFile(),
SetId(),
SetJsClassName(),
SetJsSupportingFile(),
SetName(),
SetTemplate(),
SetTemplates(),
SetTitle(),
SetTranslate(),
SetType(),
SetValidators(),
SetViewScript()
|
Constants summary
string |
VERSION
MvcCore Extension - Form - Field - Numeric - version:
Comparison by PHP function version_compare();
MvcCore Extension - Form - Field - Numeric - version:
Comparison by PHP function version_compare();
See
http://php.net/manual/en/function.version-compare.php
|
|
Properties summary
protected
string
|
$type
Possible values: number and range in extended class.
Possible values: number and range in extended class.
|
|
protected
string[]|Closure[]
|
$validators
Validators:
- Number - to parse and check raw user input. Parse float value if possible
by Intl extension or try to determinate floating point automatically
and return float or NULL .
Validators:
- Number - to parse and check raw user input. Parse float value if possible by Intl extension or try to determinate floating point automatically and return float or NULL .
|
|
protected
float|null
|
$value
Numeric field value is always stored as float value.
Numeric field value is always stored as float value.
|
|
Properties used from MvcCore\Ext\Forms\Field\Props
$controlAttrs,
$cssClasses,
$cssSupportingFile,
$declaredProtectedProperties,
$errors,
$form,
$id,
$jsClassName,
$jsSupportingFile,
$name,
$templates,
$title,
$translate,
$translateTitle,
$view,
$viewScript
|