Class Form

Description

A library of form field generation helpers, mainly useful automate data preservation on form errors

Located in /class.form.php (line 24)


                
			
Variable Summary
static mixed $aFields
Method Summary
static mixed Input (array $aAttributes, [bool $bReturn = false])
static mixed Label (array $aAttributes, [bool $bReturn = false])
static void Load (mixed $oObject, [ &$aTarget = null], array $aTarget)
static mixed Select (array $aAttributes, [bool $bReturn = false])
static mixed TextArea (array $aAttributes, [bool $bReturn = false])
Variables
static mixed $aFields = array() (line 29)

Stores the form field values added through Load()

  • access: public
Methods
static method Input (line 128)

Generate an input element for the form. Note that the supplied attributes are not validated to be valid attributes for the element. Each element provided is added to the XHTML tag.

  • return: If bReturn is true, returns a string with the XHTML, otherwise void
  • access: public
static mixed Input (array $aAttributes, [bool $bReturn = false])
  • array $aAttributes: An array of attributes for the HTML element
  • bool $bReturn: Optional; Controls whether or not to return the HTML, otherwise echo it. Default: false
static method Label (line 78)

Generate a label for the form. Note that the supplied attributes are not validated to be valid attributes for the element. Each element provided is added to the XHTML tag. The "label" element of aAttributes specifies the text of the label.

  • return: If bReturn is true, returns a string with the XHTML, otherwise void
  • access: public
static mixed Label (array $aAttributes, [bool $bReturn = false])
  • array $aAttributes: An array of attributes for the HTML element
  • bool $bReturn: Optional; Controls whether or not to return the HTML, otherwise echo it. Default: false
static method Load (line 44)

Loads the specified array or object into the classes aFields array. These values are later used by the field generation helpers for setting the value of the form field. This method will recursively iterate through a multidimensional array, or an object with member objects to load all data within the array or object.

  • access: public
static void Load (mixed $oObject, [ &$aTarget = null], array $aTarget)
  • mixed $oObject: An array or object of keys and values to load into the forms data array
  • array $aTarget: Optional; Used to aid in loading associate form array values when this method is called recursively. Default: null
  • &$aTarget
static method Select (line 192)

Generate a select element for the form. Note that the supplied attributes are not validated to be valid attributes for the element. Each element provided is added to the XHTML tag.

The options are specified by aAttributes[ options ] as an array of key => values to display in the select

The default (selected) attribute is controlled by aAttributes[ default ], which should match a valid key in aAttributes[ options ]

  • return: If bReturn is true, returns a string with the XHTML, otherwise void
  • access: public
static mixed Select (array $aAttributes, [bool $bReturn = false])
  • array $aAttributes: An array of attributes for the HTML element
  • bool $bReturn: Optional; Controls whether or not to return the HTML, otherwise echo it. Default: false
static method TextArea (line 259)

Generate a textarea element for the form. Note that the supplied attributes are not validated to be valid attributes for the element. Each element provided is added to the XHTML tag.

  • return: If bReturn is true, returns a string with the XHTML, otherwise void
  • access: public
static mixed TextArea (array $aAttributes, [bool $bReturn = false])
  • array $aAttributes: An array of attributes for the HTML element
  • bool $bReturn: Optional; Controls whether or not to return the HTML, otherwise echo it. Default: false

Documentation generated on Thu, 25 Feb 2010 15:59:40 -0500 by phpDocumentor 1.4.3