Trait for all visible fields, for classes:
- \MvcCore\Ext\Forms\Fields\Button
- \MvcCore\Ext\Forms\Fields\SubmitButton
- \MvcCore\Ext\Forms\Fields\ResetButton
- \MvcCore\Ext\Forms\Fields\Color
- \MvcCore\Ext\Forms\Fields\Date
- \MvcCore\Ext\Forms\Fields\DateTime
- \MvcCore\Ext\Forms\Fields\Month
- \MvcCore\Ext\Forms\Fields\Time
- \MvcCore\Ext\Forms\Fields\Week
- \MvcCore\Ext\Forms\Fields\File
- \MvcCore\Ext\Forms\Fields\Checkbox
- \MvcCore\Ext\Forms\Fields\Image
- \MvcCore\Ext\Forms\Fields\Number
- \MvcCore\Ext\Forms\Fields\Range
- \MvcCore\Ext\Forms\Fields\ResetInput
- \MvcCore\Ext\Forms\Fields\Select
- \MvcCore\Ext\Forms\Fields\CountrySelect
- \MvcCore\Ext\Forms\Fields\SubmitInput
- \MvcCore\Ext\Forms\Fields\Text
- \MvcCore\Ext\Forms\Fields\Email
- \MvcCore\Ext\Forms\Fields\Password
- \MvcCore\Ext\Forms\Fields\Search
- \MvcCore\Ext\Forms\Fields\Tel
- \MvcCore\Ext\Forms\Fields\Url
- \MvcCore\Ext\Forms\Fields\Textarea
- \MvcCore\Ext\Forms\FieldsGroup
- \MvcCore\Ext\Forms\CheckboxGroup
- \MvcCore\Ext\Forms\RadioGroup
Methods summary
public
string|null
|
#
GetLabel( )
Get control label visible text.
If field form has configured any translator,
translation will be processed automatically
before rendering process. Default value is NULL .
Get control label visible text.
If field form has configured any translator,
translation will be processed automatically
before rendering process. Default value is NULL .
Returns
string|null
|
public
MvcCore\Ext\Forms\Field
|
#
SetLabel( string|null $label, boolean|null $translateLabel = NULL )
Set control label visible text.
If field form has configured any translator,
translation will be processed automatically
before rendering process. Default value is NULL .
Set control label visible text.
If field form has configured any translator,
translation will be processed automatically
before rendering process. Default value is NULL .
Parameters
Returns
|
public
string
|
#
GetLabelSide( )
Get label side from rendered field - location where label will be rendered.
By default $this->labelSide is configured to left .
If you want to reconfigure it to different side,
the only possible value is right .
You can use constants:
- \MvcCore\Ext\Forms\IField::LABEL_SIDE_LEFT
- \MvcCore\Ext\Forms\IField::LABEL_SIDE_RIGHT
Get label side from rendered field - location where label will be rendered.
By default $this->labelSide is configured to left .
If you want to reconfigure it to different side,
the only possible value is right .
You can use constants:
- \MvcCore\Ext\Forms\IField::LABEL_SIDE_LEFT
- \MvcCore\Ext\Forms\IField::LABEL_SIDE_RIGHT
Returns
string
|
public
MvcCore\Ext\Forms\Field
|
#
SetLabelSide( string $labelSide = \MvcCore\Ext\Forms\IField::LABEL_SIDE_RIGHT )
Set label side from rendered field - location where label will be rendered.
By default $this->labelSide is configured to left .
If you want to reconfigure it to different side,
the only possible value is right .
You can use constants:
- \MvcCore\Ext\Forms\IField::LABEL_SIDE_LEFT
- \MvcCore\Ext\Forms\IField::LABEL_SIDE_RIGHT
Set label side from rendered field - location where label will be rendered.
By default $this->labelSide is configured to left .
If you want to reconfigure it to different side,
the only possible value is right .
You can use constants:
- \MvcCore\Ext\Forms\IField::LABEL_SIDE_LEFT
- \MvcCore\Ext\Forms\IField::LABEL_SIDE_RIGHT
Parameters
Returns
|
public
string
|
#
GetRenderMode( )
Get rendering mode flag how to render field and it's label.
Default value is normal to render label and field, label
first or field first by another property $field->SetLabelSide('left' | 'right'); .
But if you want to render label around field or if you don't want
to render any label, you can change this with constants (values):
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_NORMAL - <label /><input />
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_LABEL_AROUND - <label><input /></label>
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_NO_LABEL - <input />
Get rendering mode flag how to render field and it's label.
Default value is normal to render label and field, label
first or field first by another property $field->SetLabelSide('left' | 'right'); .
But if you want to render label around field or if you don't want
to render any label, you can change this with constants (values):
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_NORMAL - <label /><input />
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_LABEL_AROUND - <label><input /></label>
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_NO_LABEL - <input />
Returns
string
|
public
MvcCore\Ext\Form
|
#
SetRenderMode( string $renderMode = \MvcCore\Ext\IForm::FIELD_RENDER_MODE_LABEL_AROUND )
Set rendering mode flag how to render field and it's label.
Default value is normal to render label and field, label
first or field first by another property $field->SetLabelSide('left' | 'right'); .
But if you want to render label around field or if you don't want
to render any label, you can change this with constants (values):
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_NORMAL - <label /><input />
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_LABEL_AROUND - <label><input /></label>
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_NO_LABEL - <input />
Set rendering mode flag how to render field and it's label.
Default value is normal to render label and field, label
first or field first by another property $field->SetLabelSide('left' | 'right'); .
But if you want to render label around field or if you don't want
to render any label, you can change this with constants (values):
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_NORMAL - <label /><input />
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_LABEL_AROUND - <label><input /></label>
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_NO_LABEL - <input />
Parameters
Returns
|
public
array
&
|
#
GetLabelAttrs( )
Get collection with <label> HTML element
additional attributes by array keys/values.
There are no system attributes as: id ,for or
class attributes, those attributes have it's own
configurable properties with it's own getters.
Label class attribute has always the same css
classes as it's field automatically.
Default value is an empty array to not render
any additional attributes.
Get collection with <label> HTML element
additional attributes by array keys/values.
There are no system attributes as: id ,for or
class attributes, those attributes have it's own
configurable properties with it's own getters.
Label class attribute has always the same css
classes as it's field automatically.
Default value is an empty array to not render
any additional attributes.
Returns
array
|
public
mixed
|
#
GetLabelAttr( string $name = 'data-*' )
Get <label> HTML element additional attribute
by name and with it's value. Do not use system
attributes as: id ,for or class , those
attributes has it's own configurable properties
with it's own getters. Label class attribute
has always the same css classes as it's field automatically.
If attribute doesn't exist, NULL is returned.
Get <label> HTML element additional attribute
by name and with it's value. Do not use system
attributes as: id ,for or class , those
attributes has it's own configurable properties
with it's own getters. Label class attribute
has always the same css classes as it's field automatically.
If attribute doesn't exist, NULL is returned.
Parameters
Returns
mixed
|
public
MvcCore\Ext\Form
|
#
SetLabelAttrs( array $attrs = [] )
Set collection with <label> HTML element
additional attributes by array keys/values.
Do not use system attributes as: id ,for or
class attributes, those attributes have it's own
configurable properties by setter methods
or by constructor config array. Label class
attribute has always the same css classes as
it's field automatically. Default value is an empty
array to not render any additional attributes.
All previously defined additional label attributes
will be replaced by given array.
Set collection with <label> HTML element
additional attributes by array keys/values.
Do not use system attributes as: id ,for or
class attributes, those attributes have it's own
configurable properties by setter methods
or by constructor config array. Label class
attribute has always the same css classes as
it's field automatically. Default value is an empty
array to not render any additional attributes.
All previously defined additional label attributes
will be replaced by given array.
Parameters
Returns
|
public
MvcCore\Ext\Form
|
#
SetLabelAttr( string $name, mixed $value )
Set <label> HTML element additional attribute
by name and with it's value. Do not use system
attributes as: id ,for or class , those
attributes have it's own configurable properties
by setter methods or by constructor config array.
Label class attribute has always the same css
classes as it's field automatically.
Given additional label attribute will be directly
set into additional attributes array and any
previous attribute with the same name will be overwritten.
Set <label> HTML element additional attribute
by name and with it's value. Do not use system
attributes as: id ,for or class , those
attributes have it's own configurable properties
by setter methods or by constructor config array.
Label class attribute has always the same css
classes as it's field automatically.
Given additional label attribute will be directly
set into additional attributes array and any
previous attribute with the same name will be overwritten.
Parameters
Returns
|
public
MvcCore\Ext\Form
|
#
AddLabelAttrs( array $attrs = [] )
Add collection with <label> HTML element
additional attributes by array keys/values.
Do not use system attributes as: id ,for or
class attributes, those attributes have it's own
configurable properties by setter methods
or by constructor config array. Label class
attribute has always the same css classes as
it's field automatically.
All given additional label attributes
will be merged with previously defined attributes.
Add collection with <label> HTML element
additional attributes by array keys/values.
Do not use system attributes as: id ,for or
class attributes, those attributes have it's own
configurable properties by setter methods
or by constructor config array. Label class
attribute has always the same css classes as
it's field automatically.
All given additional label attributes
will be merged with previously defined attributes.
Parameters
Returns
|
Properties summary
protected
string
|
$label
Control label visible text.
If field form has configured any translator,
translation will be processed automatically
before rendering process. Default value is NULL .
Control label visible text.
If field form has configured any translator,
translation will be processed automatically
before rendering process. Default value is NULL .
|
|
protected
boolean
|
$translateLabel
Boolean to translate label text, TRUE by default.
Boolean to translate label text, TRUE by default.
|
|
protected
string
|
$labelSide
Label side from rendered field - location where label will be rendered.
By default $this->labelSide is configured to left .
If you want to reconfigure it to different side,
the only possible value is right .
You can use constants:
- \MvcCore\Ext\Forms\IField::LABEL_SIDE_LEFT
- \MvcCore\Ext\Forms\IField::LABEL_SIDE_RIGHT
Label side from rendered field - location where label will be rendered.
By default $this->labelSide is configured to left .
If you want to reconfigure it to different side,
the only possible value is right .
You can use constants:
- \MvcCore\Ext\Forms\IField::LABEL_SIDE_LEFT
- \MvcCore\Ext\Forms\IField::LABEL_SIDE_RIGHT
|
#
\MvcCore\Ext\Forms\IField::LABEL_SIDE_LEFT
|
protected
string
|
$renderMode
Rendering mode flag how to render field and it's label.
Default value is normal to render label and field, label
first or field first by another property $field->labelSide = 'left' | 'right'; .
But if you want to render label around field or if you don't want
to render any label, you can change this with constants (values):
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_NORMAL - <label /><input />
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_LABEL_AROUND - <label><input /></label>
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_NO_LABEL - <input />
Rendering mode flag how to render field and it's label.
Default value is normal to render label and field, label
first or field first by another property $field->labelSide = 'left' | 'right'; .
But if you want to render label around field or if you don't want
to render any label, you can change this with constants (values):
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_NORMAL - <label /><input />
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_LABEL_AROUND - <label><input /></label>
- \MvcCore\Ext\Form::FIELD_RENDER_MODE_NO_LABEL - <input />
|
|
protected
array
|
$labelAttrs
Collection with <label> HTML element
additional attributes by array keys/values.
Do not use system attributes as: id ,for or
class , those attributes has it's own
configurable properties by setter methods
or by constructor config array. Label class
attribute has always the same css classes as
it's field automatically. Default value is an empty
array to not render any additional attributes.
Collection with <label> HTML element
additional attributes by array keys/values.
Do not use system attributes as: id ,for or
class , those attributes has it's own
configurable properties by setter methods
or by constructor config array. Label class
attribute has always the same css classes as
it's field automatically. Default value is an empty
array to not render any additional attributes.
|
|