HTML_QuickForm2
[ class tree: HTML_QuickForm2 ] [ index: HTML_QuickForm2 ] [ all elements ]

Class: HTML_QuickForm2

Source Location: /HTML_QuickForm2-2.0.0/HTML/QuickForm2.php

Class Overview

HTML_Common2
   |
   --HTML_QuickForm2_Node
      |
      --HTML_QuickForm2_Container
         |
         --HTML_QuickForm2

Class representing a HTML form


Author(s):

Version:

  • Release: 2.0.0

Variables

Methods


Inherited Variables

Inherited Methods

Class: HTML_QuickForm2_Container

HTML_QuickForm2_Container::addElement()
Appends an element to the container (possibly creating it first)
HTML_QuickForm2_Container::appendChild()
Appends an element to the container
HTML_QuickForm2_Container::arrayMerge()
Merges two arrays
HTML_QuickForm2_Container::count()
Returns the number of elements in the container
HTML_QuickForm2_Container::getChildValues()
Returns the array containing child elements' values
HTML_QuickForm2_Container::getElementById()
Returns an element if its id is found
HTML_QuickForm2_Container::getElements()
Returns an array of this container's elements
HTML_QuickForm2_Container::getElementsByName()
Returns an array of elements which name corresponds to element
HTML_QuickForm2_Container::getIterator()
Returns a recursive iterator for the container elements
HTML_QuickForm2_Container::getJavascriptTriggers()
HTML_QuickForm2_Container::getJavascriptValue()
Returns Javascript code for getting the element's value
HTML_QuickForm2_Container::getRawValue()
Returns the container's value without filters applied
HTML_QuickForm2_Container::getRecursiveIterator()
Returns a recursive iterator iterator for the container elements
HTML_QuickForm2_Container::getValue()
Returns the container's value, possibly with filters applied
HTML_QuickForm2_Container::insertBefore()
Inserts an element in the container
HTML_QuickForm2_Container::persistentFreeze()
HTML_QuickForm2_Container::prependsName()
Whether container prepends its name to names of contained elements
HTML_QuickForm2_Container::removeChild()
Removes the element from this container
HTML_QuickForm2_Container::render()
Renders the container using the given renderer
HTML_QuickForm2_Container::setName()
HTML_QuickForm2_Container::toggleFrozen()
HTML_QuickForm2_Container::updateValue()
Called when the element needs to update its value from form's data sources
HTML_QuickForm2_Container::validate()
Performs the server-side validation
HTML_QuickForm2_Container::__call()
Appends an element to the container, creating it first
HTML_QuickForm2_Container::__toString()

Class: HTML_QuickForm2_Node

HTML_QuickForm2_Node::__construct()
Class constructor
HTML_QuickForm2_Node::addFilter()
Adds a filter
HTML_QuickForm2_Node::addRecursiveFilter()
Adds a recursive filter
HTML_QuickForm2_Node::addRule()
Adds a validation rule
HTML_QuickForm2_Node::applyFilter()
Helper function for applying filter callback to a value
HTML_QuickForm2_Node::applyFilters()
Applies non-recursive filters on element value
HTML_QuickForm2_Node::createRule()
Creates a validation rule
HTML_QuickForm2_Node::generateId()
Generates an id for the element
HTML_QuickForm2_Node::getContainer()
Returns the element containing current
HTML_QuickForm2_Node::getData()
Returns the element options
HTML_QuickForm2_Node::getDataSources()
Returns the data sources for this element
HTML_QuickForm2_Node::getError()
Returns the error message for the element
HTML_QuickForm2_Node::getId()
Returns the element's id
HTML_QuickForm2_Node::getJavascriptTriggers()
Returns IDs of form fields that should trigger "live" Javascript validation
HTML_QuickForm2_Node::getJavascriptValue()
Returns Javascript code for getting the element's value
HTML_QuickForm2_Node::getLabel()
Returns the element's label(s)
HTML_QuickForm2_Node::getName()
Returns the element's name
HTML_QuickForm2_Node::getRawValue()
Returns the element's value without filters applied
HTML_QuickForm2_Node::getType()
Returns the element's type
HTML_QuickForm2_Node::getValue()
Returns the element's value, possibly with filters applied
HTML_QuickForm2_Node::isRequired()
Checks whether an element is required
HTML_QuickForm2_Node::onAttributeChange()
Intercepts setting 'name' and 'id' attributes
HTML_QuickForm2_Node::persistentFreeze()
Changes the element's persistent freeze behaviour
HTML_QuickForm2_Node::removeRule()
Removes a validation rule
HTML_QuickForm2_Node::render()
Renders the element using the given renderer
HTML_QuickForm2_Node::renderClientRules()
Adds element's client-side validation rules to a builder object
HTML_QuickForm2_Node::setContainer()
Adds the link to the element containing current
HTML_QuickForm2_Node::setError()
Sets the error message to the element
HTML_QuickForm2_Node::setId()
Sets the element's id
HTML_QuickForm2_Node::setLabel()
Sets the element's label(s)
HTML_QuickForm2_Node::setName()
Sets the element's name
HTML_QuickForm2_Node::setValue()
Sets the element's value
HTML_QuickForm2_Node::storeId()
Stores the explicitly given id to prevent duplicate id generation
HTML_QuickForm2_Node::toggleFrozen()
Changes the element's frozen status
HTML_QuickForm2_Node::updateValue()
Called when the element needs to update its value from form's data sources
HTML_QuickForm2_Node::validate()
Performs the server-side validation

Class Details

[line 67]
Class representing a HTML form


[ Top ]


Class Variables

$datasources = array()

[line 73]

Data sources providing values for form elements
  • Access: protected

Type:   array


[ Top ]

$watchedAttributes = array('id', 'method')

[line 79]

We do not allow setting "method" and "id" other than through constructor
  • Access: protected

Type:   array
Overrides:   Array


[ Top ]



Method Detail

__construct (Constructor)   [line 91]

HTML_QuickForm2 __construct( string $id, [string $method = 'post'], [string|array $attributes = null], [bool $trackSubmit = true])

Class constructor, form's "id" and "method" attributes can only be set here
  • Access: public

Overrides HTML_QuickForm2_Node::__construct() (Class constructor)

Parameters:

string   $id     "id" attribute of <form> tag
string   $method     HTTP method used to submit the form
string|array   $attributes     Additional HTML attributes (either a string or an array)
bool   $trackSubmit     Whether to track if the form was submitted by adding a special hidden field

[ Top ]

addDataSource   [line 145]

void addDataSource( HTML_QuickForm2_DataSource $datasource)

Adds a new data source to the form
  • Access: public

Parameters:

HTML_QuickForm2_DataSource   $datasource     Data source

[ Top ]

getDataSources   [line 177]

array getDataSources( )

Returns the list of data sources attached to the form
  • Access: public

Overrides HTML_QuickForm2_Node::getDataSources() (Returns the data sources for this element)
[ Top ]

getType   [line 182]

void getType( )

  • Access: public

Overrides HTML_QuickForm2_Node::getType() (Returns the element's type)
[ Top ]

isSubmitted   [line 200]

bool isSubmitted( )

Tells whether the form was already submitted

This is a shortcut for checking whether there is an instance of Submit data source in the list of form data sources

  • Access: public

[ Top ]

onAttributeChange   [line 120]

void onAttributeChange( $name, [ $value = null])

  • Access: protected

Overrides HTML_QuickForm2_Node::onAttributeChange() (Intercepts setting 'name' and 'id' attributes)

Parameters:

   $name     
   $value     

[ Top ]

render   [line 227]

HTML_QuickForm2_Renderer render( HTML_QuickForm2_Renderer $renderer)

Renders the form using the given renderer
  • Access: public

Overrides HTML_QuickForm2_Container::render() (Renders the container using the given renderer)

Parameters:

HTML_QuickForm2_Renderer   $renderer     

[ Top ]

setContainer   [line 127]

void setContainer( [HTML_QuickForm2_Container $container = null])

  • Access: protected

Overrides HTML_QuickForm2_Node::setContainer() (Adds the link to the element containing current)

Parameters:

HTML_QuickForm2_Container   $container     

[ Top ]

setDataSources   [line 159]

void setDataSources( $datasources)

Replaces the list of form's data sources with a completely new one
  • Throws: HTML_QuickForm2_InvalidArgumentException if given array contains something that is not a valid data source
  • Access: public

Parameters:

array   $datasources     A new data source list

[ Top ]

setId   [line 132]

void setId( [ $id = null])

  • Access: public

Overrides HTML_QuickForm2_Node::setId() (Sets the element's id)

Parameters:

   $id     

[ Top ]

setValue   [line 187]

void setValue( $value)

  • Access: public

Overrides HTML_QuickForm2_Node::setValue() (Sets the element's value)

Parameters:

   $value     

[ Top ]

skipInternalFields   [line 247]

array skipInternalFields( array $value)

Filter for form's getValue() removing internal fields' values from the array

Parameters:

array   $value     

[ Top ]

validate   [line 215]

boolean validate( )

Performs the server-side validation
  • Return: Whether all form's elements are valid
  • Access: public

Overrides HTML_QuickForm2_Container::validate() (Performs the server-side validation)
[ Top ]


Documentation generated on Tue, 26 Jun 2012 15:30:26 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.