Class Text
Responsibility: init, pre-dispatch and render <input>
HTML element with types text
and types email
, password
, search
, tel
and url
in extended class. Text
field and it's extended fields could have their own validator(s) to check submitted value for min length/max length/pattern and some of extended classes also dangerous characters in submitted text value(s). But it don't prevent SQL inject attacks and more.
-
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\Text
implements
MvcCore\Ext\Forms\Fields\IVisibleField,
MvcCore\Ext\Forms\Fields\ILabel,
MvcCore\Ext\Forms\Fields\IPattern,
MvcCore\Ext\Forms\Fields\IMinMaxLength,
MvcCore\Ext\Forms\Fields\IDataList
uses
MvcCore\Ext\Forms\Field\Props\VisibleField,
MvcCore\Ext\Forms\Field\Props\Label,
MvcCore\Ext\Forms\Field\Props\Pattern,
MvcCore\Ext\Forms\Field\Props\MinMaxLength,
MvcCore\Ext\Forms\Field\Props\DataList,
MvcCore\Ext\Forms\Field\Props\AutoComplete,
MvcCore\Ext\Forms\Field\Props\PlaceHolder,
MvcCore\Ext\Forms\Field\Props\Size,
MvcCore\Ext\Forms\Field\Props\SpellCheck,
MvcCore\Ext\Forms\Field\Props\InputMode
Methods summary
public
MvcCore\Ext\Forms\Fields\Text
|
#
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, if any pattern property value defined.
- Set up min/max length validator if necessary.
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, if any pattern property value defined.
- Set up min/max length validator if necessary.
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.
- Translate placeholder 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.
- Translate placeholder 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(),
GetValue(),
GetViewScript(),
HasValidator(),
RemoveValidator(),
Render(),
RenderControlInsideLabel(),
RenderErrors(),
RenderLabel(),
RenderLabelAndControl(),
RenderNaturally(),
RenderTemplate(),
SetControlAttr(),
SetControlAttrs(),
SetCssClasses(),
SetCssSupportingFile(),
SetId(),
SetJsClassName(),
SetJsSupportingFile(),
SetName(),
SetTemplate(),
SetTemplates(),
SetTitle(),
SetTranslate(),
SetType(),
SetValidators(),
SetValue(),
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(),
GetValue(),
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(),
SetValue(),
SetViewScript()
|
Constants summary
string |
VERSION
MvcCore Extension - Form - Field - Text - version:
Comparison by PHP function version_compare();
MvcCore Extension - Form - Field - Text - version:
Comparison by PHP function version_compare();
See
http://php.net/manual/en/function.version-compare.php
|
|
Properties summary
protected
string
|
$type
Possible values: text and email , password , search , tel and url in extended class.
Possible values: text and email , password , search , tel and url in extended class.
|
|
protected
string[]|Closure[]
|
$validators
Validators:
- SafeString - remove from submitted value base ASCII characters from 0 to 31 incl.
(first column) and escape special characters: & " ' < > | = \ % .
This validator is not prevent SQL inject attacks!
Validators:
- SafeString - remove from submitted value base ASCII characters from 0 to 31 incl. (first column) and escape special characters: & " ' < > | = \ % . This validator is not prevent SQL inject attacks!
|
|
Properties used from MvcCore\Ext\Forms\Field\Props
$controlAttrs,
$cssClasses,
$cssSupportingFile,
$declaredProtectedProperties,
$errors,
$form,
$id,
$jsClassName,
$jsSupportingFile,
$name,
$templates,
$title,
$translate,
$translateTitle,
$value,
$view,
$viewScript
|