Class Range
Responsibility: init, pre-dispatch and render <input>
HTML element with type range
. Range
field has it's own validator(s) to parse and check submitted value by min/max/step/pattern. This field always return parsed float
or NULL
or for multiple
field it always return array of float
s or empty array.
-
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
-
MvcCore\Ext\Forms\Fields\Range
implements
MvcCore\Ext\Forms\Fields\IMultiple
uses
MvcCore\Ext\Forms\Field\Props\Multiple
Methods summary
public
array|float|null
|
#
GetValue( )
If range has multiple attribute, this function
returns array of float s. If Range field has not multiple
attribute, this function returns float .
If there is no value, function returns NULL .
If range has multiple attribute, this function
returns array of float s. If Range field has not multiple
attribute, this function returns float .
If there is no value, function returns NULL .
Returns
array|float|null
Overrides
|
public
MvcCore\Ext\Forms\Fields\Select
|
#
SetValue( array|float|null $value )
If range has multiple attribute, set to this function
array of float s. If Range field has not multiple
attribute, set to this function float .
If you don't want any pre initialized value, set NULL .
If range has multiple attribute, set to this function
array of float s. If Range field has not multiple
attribute, set to this function float .
If you don't want any pre initialized value, set NULL .
Parameters
Returns
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.
- Translate placeholder text if necessary.
- Set up tab-index if necessary.
- Add supporting javascript and css file.
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.
- Translate placeholder text if necessary.
- Set up tab-index if necessary.
- Add supporting javascript and css file.
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\Fields\ILabel
AddLabelAttrs(),
GetLabel(),
GetLabelAttr(),
GetLabelAttrs(),
GetLabelSide(),
GetRenderMode(),
SetLabel(),
SetLabelAttr(),
SetLabelAttrs(),
SetLabelSide(),
SetRenderMode()
|
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\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 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()
|
Properties summary
protected
string
|
$type
|
|
protected
string[]|Closure[]
|
$validators
Validators:
- Range - validate numeric raw user input. Parse numeric value (or two values) by locale conventions
and check minimum, maximum and step if necessary.
Validators:
- Range - validate numeric raw user input. Parse numeric value (or two values) by locale conventions and check minimum, maximum and step if necessary.
|
|
protected
string
|
$jsClassName
Supporting javascript full javascript class name.
If you want to use any custom supporting javascript prototyped class
for any additional purposes for your custom field, you need to use
$field->jsSupportingFile property to define path to your javascript file
relatively from configured \MvcCore\Ext\Form::SetJsSupportFilesRootDir(...);
value. Than you have to add supporting javascript file path into field form
in $field->PreDispatch(); method to render those files immediately after form
(once) or by any external custom assets renderer configured by:
$form->SetJsSupportFilesRenderer(...); method.
Or you can add your custom supporting javascript files into response by your
own and also you can run your helper javascripts also by your own. Is up to you.
NULL by default.
Supporting javascript full javascript class name.
If you want to use any custom supporting javascript prototyped class
for any additional purposes for your custom field, you need to use
$field->jsSupportingFile property to define path to your javascript file
relatively from configured \MvcCore\Ext\Form::SetJsSupportFilesRootDir(...);
value. Than you have to add supporting javascript file path into field form
in $field->PreDispatch(); method to render those files immediately after form
(once) or by any external custom assets renderer configured by:
$form->SetJsSupportFilesRenderer(...); method.
Or you can add your custom supporting javascript files into response by your
own and also you can run your helper javascripts also by your own. Is up to you.
NULL by default.
|
|
protected
string
|
$jsSupportingFile
Field supporting javascript file relative path.
If you want to use any custom supporting javascript file (with prototyped
class) for any additional purposes for your custom field, you need to
define path to your javascript file relatively from configured
\MvcCore\Ext\Form::SetJsSupportFilesRootDir(...); value.
Than you have to add supporting javascript file path into field form
in $field->PreDispatch(); method to render those files immediately after form
(once) or by any external custom assets renderer configured by:
$form->SetJsSupportFilesRenderer(...); method.
Or you can add your custom supporting javascript files into response by your
own and also you can run your helper javascripts also by your own. Is up to you.
NULL by default.
Field supporting javascript file relative path.
If you want to use any custom supporting javascript file (with prototyped
class) for any additional purposes for your custom field, you need to
define path to your javascript file relatively from configured
\MvcCore\Ext\Form::SetJsSupportFilesRootDir(...); value.
Than you have to add supporting javascript file path into field form
in $field->PreDispatch(); method to render those files immediately after form
(once) or by any external custom assets renderer configured by:
$form->SetJsSupportFilesRenderer(...); method.
Or you can add your custom supporting javascript files into response by your
own and also you can run your helper javascripts also by your own. Is up to you.
NULL by default.
|
#
\MvcCore\Ext\IForm::FORM_ASSETS_DIR_REPLACEMENT . '/fields/range.js'
|
protected
string
|
$cssSupportingFile
Field supporting css file relative path.
If you want to use any custom supporting css file
for any additional purposes for your custom field, you need to
define path to your css file relatively from configured
\MvcCore\Ext\Form::SetCssSupportFilesRootDir(...); value.
Than you have to add supporting css file path into field form
in $field->PreDispatch(); method to render those files immediately after form
(once) or by any external custom assets renderer configured by:
$form->SetCssSupportFilesRenderer(...); method.
Or you can add your custom supporting css files into response by your
own and also you can run your helper css also by your own. Is up to you.
NULL by default.
Field supporting css file relative path.
If you want to use any custom supporting css file
for any additional purposes for your custom field, you need to
define path to your css file relatively from configured
\MvcCore\Ext\Form::SetCssSupportFilesRootDir(...); value.
Than you have to add supporting css file path into field form
in $field->PreDispatch(); method to render those files immediately after form
(once) or by any external custom assets renderer configured by:
$form->SetCssSupportFilesRenderer(...); method.
Or you can add your custom supporting css files into response by your
own and also you can run your helper css also by your own. Is up to you.
NULL by default.
|
#
\MvcCore\Ext\IForm::FORM_ASSETS_DIR_REPLACEMENT . '/fields/range.css'
|
Properties used from MvcCore\Ext\Forms\Field\Props
$controlAttrs,
$cssClasses,
$declaredProtectedProperties,
$errors,
$form,
$id,
$name,
$templates,
$title,
$translate,
$translateTitle,
$value,
$view,
$viewScript
|