Phang  2.1
All Classes Files Functions Variables Pages
Public Member Functions | Public Attributes | Protected Attributes
Form Class Reference

An HTML Form object. More...

Inheritance diagram for Form:
Html_Element Base

List of all members.

Public Member Functions

 __construct ($options=array())
 Constructor.
 init_fields ($fields=null)
 Create fields from array of field objects.
 add ($field)
 Adds a field to the form.
 add_button ($button)
 Adds a button to the form.
 remove ($field_name)
 Removes a field with the supplied field name.
 has_fields ()
 Checks whether the form has fields.
 has_field ($field_name)
 Checks whether the form has a specific field.
 get ($field_name)
 Returns a field by the field name.
 get_fields ($include_hidden=false)
 Returns fields.
 get_fields_hidden ()
 Returns hidden fields.
 render ($renderer=null)
 String representation of form.
- Public Member Functions inherited from Html_Element
 __construct ($tag, $attrs=array(), $children=array())
 Creates a new Html_Element $tag = The tag name 'a','ul', etc $attrs(optional) = A associative array of attributes and there values $children(optional) = A array of child Html_Element.
 has_children ()
 Returns true if the element has children.
 remove_children ()
 Removes all HTML children of the element.
 add_child ($child)
 Adds a Element as a child to this one $child = Another Html_Element or a String.
 add_class ($class_name)
 Adds a class to the element.
 has_class ($class_name)
 Checks if a the element has a certain class attribute.
 set_attr ($attr, $value)
 Sets a attribute to this Element $attr = The attribute name 'id', 'class', etc $value = The value of the attribute.
 set_attrs ($attrs)
 Set an element's attributes in one swoop...
 get_attr ($key)
 Returns the value of an element's attribute, if the value is not set, returns ''.
 remove_attribute ($key)
 Remove an attribute.
 render ()
 Returns this Element as a String Allowing echo element; etc.
 __toString ()
 Convienience fucntion for -PHP5.1 as the magic __toString() is not available!
- Public Member Functions inherited from Base
 __call ($function, $params)
 The 'magic' call method will get/set for us invoked when the interpreter can not find a method the user is asking for.
 set_parameters ($arguments)
 Set variables from an array to member fields requires $this->optional_arguments or $this->required_arguments to have been set by the subclass.

Public Attributes

 $fields = array()
 Form field objects.
- Public Attributes inherited from Html_Element
 $h2o_safe = true
 This ensures that this object can be rendered in h2o.

Protected Attributes

 $buttons = array()
 Form buttons (e.g. submit)
 $method = 'post'
 Form method ('get' or 'post')
 $action = ''
 Form action (url)
 $renderer = ''
 Object to render the form as html.
 $submit_button = ''
 Text to go on a submit button.
 $optional_arguments = array('method', 'action', 'renderer', 'attrs')
 Array of options that can be set to variables.
- Protected Attributes inherited from Html_Element
 $tag = ''
 HTML tag name.
 $attrs = array()
 Element attributes.
 $children = array()
 HTML child elements.
 $classes = array()
 HTML classes.
 $id = ''
 Element ID.
 $title = ''
 Element title.
- Protected Attributes inherited from Base
 $required_arguments = array()
 Array of options that need to be set to variables.

Detailed Description

An HTML Form object.

A form is an html form element, and a collection of form controls, hidden fields, read only fields, and buttons. It is rendered by a Form_Renderer object


The documentation for this class was generated from the following file: