FormComponent
abstract class FormComponent extends FormBase
Class FormComponent
Properties
| protected array | $config | from FormBase | |
| bool | $save_requires_edit_var | from FormBase | |
| Form | $form | ||
| protected | $field_disable_save | Set to false if this field is not "saveable", e.g. static test |
from FormBase |
| $REQUEST_VARS | |||
| $name | |||
| callable|bool | $db_handler |
Methods
No description
Special Field Display for Print Purposes
Return Dom Selector for this field within the current form (This is NOT necessary unique if you are having 2 forms with identical names in form and field names
Get Element Visibility Class Formerly known as tag class
Determine visibilty based on user input on dependent fields
Get Field label
No description
returns the displayed value
No description
No description
Does this component use combined input fields which required special handling from form?
Return if the component should be shown as required with specified style class.
Init will be called AFTER __construct() and init_obj() with $this->form set
Returns TRUE if field is readonly, FALSE otherwise.
Checks if the field is hidden by a tag. It is important when validating
No description
Process e.g. file upload, resize etc.
No description
No description
Set Field Row CSS class name
Show Custom Error Message for this field
Set Field default value
Set Field Help Text
Set Flexbox Grid Class
Set Field Help Text
Field is to be loaded from and saved to database.
Field is considered to be translatable. This is usually determined automatically reading the instance configuration of the calling instance
Consider Field as readonly
Consider Field as required
Set Field label
Set label icon class
Manipulate another fields data when the value of the current field changes.
Add Custom HTML before the field element
Add Custom HTML after the field element
Set Visibility Dependency if you want your field only to be shown if another field has a specify value Array Syntax: tag, tag_source
Set field to be the event source for another dependent field. Changes of this fields values will trigger events to their dependent fields and change their visibility in the frontend
set the displayed value
No description
No description
Should this field be marked with HTML5 required attribute? HTML5 required should not be used when field may be hidden, as it might still be required frontend-wise, even if hidden!
Should this field be treated as required during request validation?
Details
in
FormBase at line 31
__construct()
FormBase constructor.
The constructor is able to set an array of properties options
in
FormBase at line 198
append(string $name, mixed $value, bool|string $key = false)
No description
in
FormBase at line 183
void
concat(string $name, string $value)
No description
in
FormBase at line 168
mixed
destroy($name)
No description
at line 269
abstract string
display_field(string $name, string|array|bool $value = '')
No description
at line 279
string
display_field_print(string $fieldname, string $default_value = '')
Special Field Display for Print Purposes
in
FormBase at line 77
mixed
get(string $name)
No description
in
FormBase at line 84
array
getConfig()
No description
at line 588
string
getDomSelector()
Return Dom Selector for this field within the current form (This is NOT necessary unique if you are having 2 forms with identical names in form and field names
at line 600
protected string
getElementVisibilityClass()
Get Element Visibility Class Formerly known as tag class
at line 501
bool
getIsVisible()
Determine visibilty based on user input on dependent fields
at line 317
string
getLabel()
Get Field label
at line 156
string
get_description()
No description
at line 257
mixed
get_display_value()
returns the displayed value
in
FormBase at line 217
array
get_group(string $prefix)
No description
in
FormBase at line 92
array
get_properties()
No description
at line 56
array|bool
get_validation_options()
No description
at line 175
get_value()
No description
at line 48
bool
hasCombinedInputFields()
Does this component use combined input fields which required special handling from form?
at line 651
protected bool
hasRequiredStyle()
Return if the component should be shown as required with specified style class.
at line 32
void
init()
Init will be called AFTER __construct() and init_obj() with $this->form set
in
FormBase at line 39
init_obj()
Initializes the form base
at line 549
$this
insertAfter(FormComponent $formComponent = null)
Insert this field after the specified field
at line 534
$this
insertBefore(FormComponent $formComponent = null)
Insert this field before the specified field
at line 374
bool
isReadonly()
Returns TRUE if field is readonly, FALSE otherwise.
in
FormBase at line 237
bool
is_displayed()
Checks if the field is hidden by a tag. It is important when validating
at line 240
void
post_process()
No description
at line 169
void
process()
Process e.g. file upload, resize etc.
at line 187
string
render(string|false $name = false, string|false $value = false)
No description
at line 231
mixed
save()
No description
in
FormBase at line 104
$this
set(string $propertyName, mixed $propertyValue)
No description
at line 396
$this
setCSSClassName(string $class = null)
Set Field Row CSS class name
at line 564
$this
setCustomErrorText(string $error_msg)
Show Custom Error Message for this field
at line 385
FormComponent
setDefaultValue(mixed $value = null)
Set Field default value
at line 418
$this
setDescriptionText(string $description = null)
Set Field Help Text
at line 578
$this
setGridClass(string $gridClass = null)
Set Flexbox Grid Class
at line 407
$this
setHelpText(string $help = null)
Set Field Help Text
at line 341
$this
setIsDBField(bool $bool = true)
Field is to be loaded from and saved to database.
at line 354
$this
setIsI18NField(bool $bool = true)
Field is considered to be translatable. This is usually determined automatically reading the instance configuration of the calling instance
at line 365
$this
setIsReadonly(bool $bool = true)
Consider Field as readonly
at line 330
$this
setIsRequired(bool $bool = true, bool $onlyRequiredIfVisible = true)
Consider Field as required
at line 293
$this
setLabel(string $label = '', string $icon_class = null)
Set Field label
at line 308
$this
setLabelIconClass(string $icon_class = '')
Set label icon class
at line 453
$this
setPopulateField(FormComponent $target, string $dataURL = null)
Manipulate another fields data when the value of the current field changes.
Common usage: Populate a second select once user chooses from the first select
at line 429
$this
setPrefixHTML(string $html = null)
Add Custom HTML before the field element
at line 440
$this
setSuffixHTML(string $html = null)
Add Custom HTML after the field element
at line 467
$this
setVisibilityDependsOn(FormComponent $formComponent = null, array $matchingValues = [])
Set Visibility Dependency if you want your field only to be shown if another field has a specify value Array Syntax: tag, tag_source
at line 491
$this
setVisibilityIsSource(bool $bool = true)
Set field to be the event source for another dependent field. Changes of this fields values will trigger events to their dependent fields and change their visibility in the frontend
Fields are automatically set to be a source if used in a call of setVisibilityDependsOn()
Array Syntax: tag_source
at line 248
set_display_value(mixed $value)
set the displayed value
in
FormBase at line 153
void
set_properties(array $array)
No description
at line 40
set_request_vars($request)
No description
at line 96
array
validate()
No description
at line 639
protected bool
validateInFrontendAsRequired()
Should this field be marked with HTML5 required attribute? HTML5 required should not be used when field may be hidden, as it might still be required frontend-wise, even if hidden!
at line 624
protected bool
validateInRequestAsRequired()
Should this field be treated as required during request validation?