Class Button
Responsibility: init, pre-dispatch and render button based on <button>
HTML element with types button
and types submit
and reset
in extended classes. Button has text OK
by default and no validators.
-
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\Button
implements
MvcCore\Ext\Forms\Fields\IVisibleField
uses
MvcCore\Ext\Forms\Field\Props\VisibleField
Methods summary
public
MvcCore\Ext\Forms\Fields\Button
|
#
__construct( array $cfg = [] )
Create new form <button> instance.
Create new form <button> instance.
Parameters
- $cfg
Config array with public properties and it's
values which you want to configure, presented
in camel case properties names syntax.
Returns
Throws
InvalidArgumentException
Overrides
|
public
MvcCore\Ext\Forms\Fields\Button
|
#
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.
- Check if exists button value string.
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.
- Check if exists button value string.
Parameters
Returns
Throws
InvalidArgumentException
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 value text 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 value text if necessary.
- Set up tab-index if necessary.
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(),
RenderControl(),
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 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()
|
Methods used from MvcCore\Ext\Forms\Field\Rendering
Render(),
RenderControl(),
RenderControlInsideLabel(),
RenderErrors(),
RenderLabel(),
RenderLabelAndControl(),
RenderNaturally(),
RenderTemplate(),
renderAttrsWithFieldVars(),
renderControlAttrsWithFieldVars(),
renderLabelAttrsWithFieldVars()
|
Constants summary
string |
VERSION
MvcCore Extension - Form - Field - Button - version:
Comparison by PHP function version_compare();
MvcCore Extension - Form - Field - Button - version:
Comparison by PHP function version_compare();
See
http://php.net/manual/en/function.version-compare.php
|
|
Properties summary
protected
string
|
$type
Possible values: button and in extended classes reset and submit .
Possible values: button and in extended classes reset and submit .
|
|
protected
string
|
$value
Default visible button text - OK . In extended classes - Reset and Submit .
This button text is automatically checked, if there is at least any
visible text and automatically translated, if any translator callable
defined in form instance.
Default visible button text - OK . In extended classes - Reset and Submit .
This button text is automatically checked, if there is at least any
visible text and automatically translated, if any translator callable
defined in form instance.
|
|
public static
string
|
$templates
Standard field control natural template string.
Standard field control natural template string.
|
#
[
'control' => '<button id="{id}" name="{name}" type="{type}"{attrs}>{value}</button>',
]
|
Properties used from MvcCore\Ext\Forms\Field\Props
$controlAttrs,
$cssClasses,
$cssSupportingFile,
$declaredProtectedProperties,
$errors,
$form,
$id,
$jsClassName,
$jsSupportingFile,
$name,
$title,
$translate,
$translateTitle,
$validators,
$view,
$viewScript
|