DomTemplate


Dom_Form

Class Dom_Form

Dom_Form

public class Dom_Form

The form package make an API available for rendering a form and its elements

The form package currently does not fully support element arrays. It can be done but it is not fully supported or tested.


Field Summary
protected array

$elements

An Array of Dom_FormElement objects

protected DOMElement

$form

protected Dom_Template

$parent

Constructor Summary

__construct(DOMElement form, mixed elements, Dom_Template parent, array element)

__construct

Method Summary
void

appendHiddenElement(string name, string value)

Append a hidden element to a form.

private void

elementExists(string key, string property)

Check if a repeat,choice,var,form (template property) exists.

array

getElementNames()

Get an array containing the form element names

Dom_FormElement

getFormElement(string name, int i)

Return the form element with the name.

array

getFormElementList(string name)

Get an array of form elements with the name value Used for radioboxes and multi select lists

unknown

getHiddenElements()

Get an array of the hidden elements in this form

void

getId()

string

getName()

Get the form name.

DOMElement

getNode()

Get the DOMElement of this form object.

int

getNumFormElements(string name)

Return the number of elements in an element namespace

Dom_Template

getTemplate()

Get the parent template for this form

void

setAction(mixed value, string action)

Set a URL that defines where to send the data when the submit button is pushed.

void

setCheckedByValue(string name, string value)

Set/unset the checkboxes and radioboxes.

void

setMethod(mixed value, string method)

The HTTP method for sending data to the action URL.

void

setTarget(mixed value, string target)

Set the method used by the form.

Field Detail

elements

protected array $elements = array()

An Array of Dom_FormElement objects


form

protected DOMElement $form = null


parent

protected Dom_Template $parent = null


Constructor Detail

__construct

public __construct(DOMElement form, mixed elements, Dom_Template parent, array element)

__construct

Parameters:
element - An array of form elements
parent - The parent object

Method Detail

appendHiddenElement

public void appendHiddenElement(string name, string value)

Append a hidden element to a form.


elementExists

private void elementExists(string key, string property)

Check if a repeat,choice,var,form (template property) exists.


getElementNames

public array getElementNames()

Get an array containing the form element names


getFormElement

public Dom_FormElement getFormElement(string name, int i)

Return the form element with the name.

Parameters:
i - optioinal index for multiple elements

getFormElementList

public array getFormElementList(string name)

Get an array of form elements with the name value Used for radioboxes and multi select lists


getHiddenElements

public unknown getHiddenElements()

Get an array of the hidden elements in this form


getId

public void getId()

getName

public string getName()

Get the form name.

Deprecated:
This is nolonger valid XHTML. use getId()

getNode

public DOMElement getNode()

Get the DOMElement of this form object.


getNumFormElements

public int getNumFormElements(string name)

Return the number of elements in an element namespace


getTemplate

public Dom_Template getTemplate()

Get the parent template for this form


setAction

public void setAction(mixed value, string action)

Set a URL that defines where to send the data when the submit button is pushed.


setCheckedByValue

public void setCheckedByValue(string name, string value)

Set/unset the checkboxes and radioboxes. NOTE: This is called by Dom_FormInputElement
$value is not required for checkboxes


setMethod

public void setMethod(mixed value, string method)

The HTTP method for sending data to the action URL. Default is get.
Possible values are:


setTarget

public void setTarget(mixed value, string target)

Set the method used by the form. Possible values are:


DomTemplate