Form_Field_Model Class Reference

Represents a form field, or a set of form fields (. More...

Inheritance diagram for Form_Field_Model:
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_Listview_Query_Model Form_Field_Number_Model Form_Field_Option_Model Form_Field_ORMObject_Model Form_Field_Perfdata_Model Form_Field_Range_Model Form_Field_Text_Model

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.

Detailed Description

Represents a form field, or a set of form fields (.

See also:
Form_Field_Group_Model).

Constructor & Destructor Documentation

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.

Parameters:
$name string
$pretty_name string

Reimplemented in Form_Field_Boolean_Model, Form_Field_Number_Model, and Form_Field_Listview_Query_Model.


Member Function Documentation

Form_Field_Model::get_name (  ) 

Get the field name.

This maps to the field name both in processed and unprocessed data

Returns:
string
Form_Field_Model::get_pretty_name (  ) 

Get the name as it should be visisble in the UI.

Can be null for some fields.

Returns:
string
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.

Returns:
string

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.

Parameters:
$raw_data array
$result Form_Result_Model
Exceptions:
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.

Parameters:
$key string
$controller string

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables

Generated on 19 Dec 2018 for ninja by  doxygen 1.6.1