Represents a form field, or a set of form fields (. More...
Public Member Functions | |
get_name () | |
Get the field name. | |
get_pretty_name () | |
Get the name as it should be visisble in the UI. | |
get_type () | |
Get the view of this field, relative to form/ directory in the views folder. | |
process_data (array $raw_data, Form_Result_Model $result) | |
Process the input data from a raw request array. | |
set_help ($key, $controller) | |
Add a more descriptive help string for this specific form element. | |
Protected Member Functions | |
__construct ($name, $pretty_name) | |
Initialize the name and pretty name for the field. |
Represents a form field, or a set of form fields (.
Form_Field_Model::__construct | ( | $ | name, | |
$ | pretty_name | |||
) | [protected] |
Initialize the name and pretty name for the field.
There is (almost) no fields that shouldn't take options. Thus (almost) all field types needs to override this method. Thus not overriding this methods is (most likely) an error. And those can do it anyway. Thus protected.
$name | string | |
$pretty_name | string |
Reimplemented in Form_Field_Boolean_Model, Form_Field_Number_Model, and Form_Field_Listview_Query_Model.
Form_Field_Model::get_name | ( | ) |
Get the field name.
This maps to the field name both in processed and unprocessed data
Form_Field_Model::get_pretty_name | ( | ) |
Get the name as it should be visisble in the UI.
Can be null for some fields.
Form_Field_Model::get_type | ( | ) | [abstract] |
Get the view of this field, relative to form/ directory in the views folder.
It should be possible to do "skins" for forms by adding a subdirectory in the form/ folder, which should re-implement the views.
Reimplemented in Form_Field_Boolean_Model, Form_Field_Conditional_Model, Form_Field_Group_Model, Form_Field_Hidden_Model, Form_Field_HtmlDecorator_Model, Form_Field_Integer_Model, Form_Field_Number_Model, Form_Field_Option_Model, Form_Field_Range_Model, Form_Field_Text_Model, Form_Field_Listview_Query_Model, Form_Field_ORMObject_Model, and Form_Field_Perfdata_Model.
Form_Field_Model::process_data | ( | array $ | raw_data, | |
Form_Result_Model $ | result | |||
) | [abstract] |
Process the input data from a raw request array.
This should validate the input and return an associative array of the form data for this field.
For most fields, this is an array of only one value, but can be more if field is of type fieldset, conditional or similar
This methods may also look objects up in the case of validation. For example, an object selector can actually return an object, a set selection can return a set.
If not matching, this methods throws an FormException or derivative.
$raw_data | array | |
$result | Form_Result_Model |
FormException |
Reimplemented in Form_Field_Boolean_Model, Form_Field_Conditional_Model, Form_Field_Group_Model, Form_Field_Hidden_Model, Form_Field_HtmlDecorator_Model, Form_Field_Integer_Model, Form_Field_Number_Model, Form_Field_Option_Model, Form_Field_Range_Model, Form_Field_Text_Model, Form_Field_Listview_Query_Model, Form_Field_ORMObject_Model, and Form_Field_Perfdata_Model.
Form_Field_Model::set_help | ( | $ | key, | |
$ | controller | |||
) |
Add a more descriptive help string for this specific form element.
This proxies the help::render() interface.
$key | string | |
$controller | string |