Class FormControl

Description

A base class from which form controls to be used with FormUI can descend

Located in /system/classes/formui.php (line 686)


	
			
Direct descendents
Class Description
FormControlNoSave A control prototype that does not save its data
FormControlText A text control based on FormControl for output via a FormUI.
FormControlTextMulti A multiple-slot text control based on FormControl for output via a FormUI.
FormControlSelect A select control based on FormControl for output via a FormUI.
FormControlTextArea A textarea control based on FormControl for output via a FormUI.
FormControlCheckbox A checkbox control based on FormControl for output via a FormUI.
FormControlHidden A hidden field control based on FormControl for output via a FormUI.
Variable Summary
mixed $caption
mixed $class
mixed $container
mixed $default
mixed $id
mixed $name
mixed $properties
mixed $storage
mixed $store_user
mixed $template
mixed $theme_obj
mixed $validators
Method Summary
FormControl __construct (string $storage, string $default, string $caption)
FormControl add_validator (mixed $validator, mixed $option...)
string checksum ()
void get ([boolean $forvalidation = true])
void get_default ()
string get_template ()
Theme get_theme (boolean $forvalidation)
boolean has_user_options ()
void move_after (object $target)
void move_before (object $target)
void pre_out ()
void remove ()
void remove_validator (string $name)
void save ([string $storage = null])
array validate ()
mixed __get (string $name)
void __set (string $name, mixed $value)
void __toString ()
Variables
mixed $caption (line 688)
  • access: protected
mixed $class = array( 'formcontrol' ) (line 696)
  • access: public
mixed $container = null (line 694)
  • access: protected
mixed $default = null (line 689)
  • access: protected
mixed $id = null (line 695)
  • access: public
mixed $name (line 697)
  • access: public
mixed $properties = array() (line 698)
  • access: protected
mixed $storage (line 691)
  • access: protected
mixed $store_user = false (line 692)
  • access: protected
mixed $template = null (line 699)
  • access: protected
mixed $theme_obj (line 693)
  • access: protected
mixed $validators = array() (line 690)
  • access: protected
Methods
Constructor __construct (line 708)

FormControl constructor - set initial settings of the control

  • access: public
FormControl __construct (string $storage, string $default, string $caption)
  • string $storage: The storage location for this control
  • string $default: The default value of the control
  • string $caption: The caption used as the label when displaying a control

Redefined in descendants as:
add_validator (line 1025)

Add a validation function to this control

Multiple parameters are passed as parameters to the validation function

  • return: Returns the control for chained execution
  • access: public
FormControl add_validator (mixed $validator, mixed $option...)
  • mixed $validator: A callback function
  • mixed $option...: Multiple parameters added to those used to call the validator callback
checksum (line 740)

Return a checksum representing this control

  • return: A checksum
  • access: public
string checksum ()
get (line 828)

Return the HTML construction of the control.

Abstract function.

  • access: public
void get ([boolean $forvalidation = true])
  • boolean $forvalidation: True if the control should output validation information with the control.

Redefined in descendants as:
get_default (line 749)

Set the default value of this control from options or userinfo if the default value isn't explicitly set on creation

  • access: protected
void get_default ()
get_form (line 726)

Retrieve the FormUI object that contains this control

  • return: The containing form
  • access: public
FormUI get_form ()
get_template (line 849)

Return the template name associated to this control, whether set explicitly or by class

  • return: The template used to display this control.
  • access: public
string get_template ()
get_theme (line 1008)

Return the theme used to output this control and perform validation if required.

  • return: The theme that will display this control
  • access: protected
Theme get_theme (boolean $forvalidation)
  • boolean $forvalidation: If true, process this control for validation (adds validation failure messages to the theme)
has_user_options (line 948)

Returns true if this control should be stored as userinfo

  • return: True if this control should be stored as userinfo
  • access: public
boolean has_user_options ()
move_after (line 1072)

Move this control after the target In the end, this will use FormUI::move()

void move_after (object $target)
  • object $target: The target control to move this control after
move_before (line 1061)

Move this control before the target In the end, this will use FormUI::move()

void move_before (object $target)
  • object $target: The target control to move this control before
pre_out (line 874)

Return the HTML/script required for this type of control.

Abstract function.

  • access: public
void pre_out ()

Redefined in descendants as:
remove (line 1080)

Remove this controls from the form

void remove ()
remove_validator (line 1044)

Removes a validation function from this control

  • access: public
void remove_validator (string $name)
  • string $name: The name of the validator to remove
save (line 789)

Store this control's value under the control's specified key.

  • access: public
void save ([string $storage = null])
  • string $storage: (optional) A storage location to store the control data

Redefined in descendants as:
validate (line 884)

Runs any attached validation functions to check validation of this control.

  • return: An array of string validation error descriptions or an empty array if no errors were found.
  • access: public
array validate ()
__get (line 915)

Magic function __get returns properties for this object.

Potential valid properties: field: A valid unique name for this control in HTML. value: The value of the control, whether the default or submitted in the form

  • return: The value of the parameter
  • access: public
mixed __get (string $name)
  • string $name: The parameter to retrieve

Redefined in descendants as:
  • FormControlPassword::__get() : Magic function __get returns properties for this object, or passes it on to the parent class Potential valid properties: value: The value of the control, whether the default or submitted in the form
  • FormControlCheckboxes::__get() : Magic __get method for returning property values Override the handling of the value property to properly return the setting of the checkbox.
  • FormControlCheckbox::__get() : Magic __get method for returning property values Override the handling of the value property to properly return the setting of the checkbox.
__set (line 971)

Magic property setter for FormControl and its descendants

  • access: public
void __set (string $name, mixed $value)
  • string $name: The name of the property
  • mixed $value: The value to set the property to
__toString (line 938)
  • access: public
void __toString ()

Documentation generated on Thu, 30 Oct 2008 20:31:12 +0100 by phpDocumentor 1.3.2