Summary
- File
- Package hierarchy Form\field
- Class hierarchy \AbstractFormField \FormFieldSelectSources
Abstract class that proposes a default implementation for the FormField interface.
Abstract class that proposes a default implementation for the FormField interface.
__construct(string $id, string $label, array $value = array(), array $field_options = array(), array $constraints = array())
Constructs and set parameters to the field.
The specific parameters of this abstract class (common with many fields) are the following:
None of these parameters is required.
| string | $id | Field identifier |
| string | $label | Field label |
| array | $value | Field value |
| array | $field_options | Map associating the parameters values to the parameters names. |
| array | $constraints | List of the constraints which must be checked when the form is been validated |
| None found |
get_id() : string
Returns the id.
| None found |
set_id(string $id)
Sets the id
| string | $id | The id. |
| None found |
get_form_id()
{@inheritdoc}
| None found |
set_form_id( $form_id)
Sets the id prefix
| $form_id |
| None found |
set_fieldset_id( $fieldset_id)
Sets the if of the fieldset which contains the field
| $fieldset_id | id of the fieldset |
| None found |
get_label() : string
Returns the label
The label
| None found |
set_label(string $label)
Sets the label
| string | $label | The label |
| None found |
get_description() : string
Returns the description
the description
| None found |
set_description(string $description)
Sets the description
| string | $description | The description |
| None found |
get_value() : mixed
| None found |
set_value(string $value)
Sets the value
| string | $value | The value |
| None found |
is_required() : true
Tells whether the field is required
if it is, false otherwise
| None found |
set_required(boolean $required)
Changes the fact that the field is required or not.
| boolean | $required | true if it's required, false otherwise |
| None found |
validate() : boolean
Validates the field by cheching if all the constraints are satisfied.
true if the form is valid
| None found |
get_validation_error_message()
Returns validation error message.
| None found |
set_validation_error_message(string $error_message)
Set the validation error message.
| string | $error_message | The message to set |
| None found |
retrieve_value()
Tries to retrieve the value in the HTTP request's parameters.
| None found |
get_html_id() : string
Returns the effective HTML id.
| None found |
add_constraint(\FormFieldConstraint $constraint)
Adds a constraint to the field constraints.
| \FormFieldConstraint | $constraint | The constraint to add |
| None found |
add_form_constraint(\FormConstraint $constraint)
Add javascript code on the onblur field parameter that makes validation
| \FormConstraint | $constraint |
| None found |
has_constraints() : boolean
Return true if the field has one or more constraints, false otherwise.
| None found |
get_js_validations() : string
Returns the javascript onsubmit code.
The javascript code that makes the validation when the form is submitted
| None found |
get_onblur_validation()
| None found |
add_event( $event, $handler)
| $event | ||
| $handler |
| None found |
is_disabled() : boolean
Tells whether the field is disabled
| None found |
disable()
Disabled the field
| None found |
enable()
Enables the field
| None found |
is_select_to_list()
| None found |
transformed_select()
| None found |
not_transformed_select()
| None found |
is_readonly()
| None found |
set_readonly( $readonly)
| $readonly |
| None found |
is_hidden()
| None found |
set_hidden( $hidden)
| $hidden |
| None found |
has_pattern()
| None found |
set_pattern( $pattern)
| $pattern |
| None found |
has_placeholder()
| None found |
set_placeholder( $placeholder)
| $placeholder |
| None found |
set_template(\Template $template)
| \Template | $template |
| None found |
display()
| None found |
compute_options(array $field_options)
| array | $field_options |
| None found |
assign_common_template_variables(\Template $template)
| \Template | $template |
| None found |
get_css_class()
| None found |
set_css_class( $css_class)
| $css_class |
| None found |
get_css_field_class()
| None found |
set_css_field_class( $css_field_class)
| $css_field_class |
| None found |
get_css_form_field_class()
| None found |
set_css_form_field_class( $css_form_field_class)
| $css_form_field_class |
| None found |
set_disabled( $disabled)
| $disabled |
| None found |
set_select_to_list( $select_to_list)
| $select_to_list |
| None found |
get_template_to_use() : \Template
| None found |
get_default_template() : \Template
| None found |
get_js_specialization_code()
| None found |
get_related_fields()
| None found |
$id : string
| None found |
$label : string
| None found |
$description : string
| None found |
$value : string
| None found |
$disabled : boolean
| None found |
$select_to_list : boolean
| None found |
$hidden : boolean
| None found |
$readonly : boolean
| None found |
$css_class : string
| None found |
$css_field_class : string
| None found |
$css_form_field_class : string
| None found |
$required : string
| None found |
$pattern : string
| None found |
$placeholder : string
| None found |
$validation_error_message : string
| None found |
$constraints : array<mixed,\FormFieldConstraint>
| None found |
$form_constraints : array<mixed,\FormConstraint>
| None found |
$template : \Template
| None found |
$events : \string[string]
| None found |
$form_id : string
| None found |
$fieldset_id : string
| None found |
$max_input :
| None found |