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

Class: HTML_QuickForm2_Container

Source Location: /HTML_QuickForm2-0.6.1/HTML/QuickForm2/Container.php

Class Overview

HTML_Common2
   |
   --HTML_QuickForm2_Node
      |
      --HTML_QuickForm2_Container

Abstract base class for simple QuickForm2 containers


Author(s):

Version:

  • Release: 0.6.1

Variables

Methods


Child classes:

HTML_QuickForm2
Class representing a HTML form
HTML_QuickForm2_Container_Fieldset
Concrete implementation of a container for fieldsets
HTML_QuickForm2_Container_Group
Base class for QuickForm2 groups of elements

Inherited Variables

Inherited Methods

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::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 elements 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 60]
Abstract base class for simple QuickForm2 containers


[ Top ]


Class Variables

$elements = array()

[line 67]

Array of elements contained in this container
  • Access: protected

Type:   array


[ Top ]



Method Detail

addElement   [line 252]

HTML_QuickForm2_Node addElement( string|HTML_QuickForm2_Node $elementOrType, [mixed $name = null], [mixed $attributes = null], [array $data = array()])

Appends an element to the container (possibly creating it first)

If the first parameter is an instance of HTML_QuickForm2_Node then all other parameters are ignored and the method just calls appendChild(). In the other case the element is first created via HTML_QuickForm2_Factory::createElement() and then added via the same method. This is a convenience method to reduce typing and ease porting from HTML_QuickForm.

  • Return: Added element
  • Throws: HTML_QuickForm2_NotFoundException
  • Throws: HTML_QuickForm2_InvalidArgumentException
  • Access: public

Parameters:

string|HTML_QuickForm2_Node   $elementOrType   —  Either type name (treated case-insensitively) or an element instance
mixed   $name   —  Element name
mixed   $attributes   —  Element attributes
array   $data   —  Element-specific data

[ Top ]

appendChild   [line 223]

HTML_QuickForm2_Node appendChild( HTML_QuickForm2_Node $element)

Appends an element to the container

If the element was previously added to the container or to another container, it is first removed there.

  • Return: Added element
  • Throws: HTML_QuickForm2_InvalidArgumentException
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Container_Group::appendChild()
Appends an element to the container

Parameters:

HTML_QuickForm2_Node   $element   —  Element to add

[ Top ]

arrayMerge   [line 191]

array arrayMerge( array $a, array $b)

Merges two arrays

Merges two arrays like the PHP function array_merge_recursive does, the difference being that existing integer keys will not be renumbered.

  • Return: resulting array
  • Access: protected

Parameters:

array   $a   — 
array   $b   — 

[ Top ]

count   [line 388]

int count( )

Returns the number of elements in the container
  • Access: public

[ Top ]

getChildValues   [line 112]

array|null getChildValues( [bool $filtered = false])

Returns the array containing child elements' values
  • Access: protected

Overridden in child classes as:

HTML_QuickForm2_Container_Group::getChildValues()

Parameters:

bool   $filtered   —  Whether child elements should apply filters on values

[ Top ]

getElementById   [line 302]

HTML_QuickForm2_Node|null getElementById( string $id)

Returns an element if its id is found
  • Access: public

Parameters:

string   $id   —  Element id to find

[ Top ]

getElements   [line 208]

array getElements( )

Returns an array of this container's elements
  • Return: Container elements
  • Access: public

[ Top ]

getElementsByName   [line 318]

array getElementsByName( string $name)

Returns an array of elements which name corresponds to element
  • Access: public

Parameters:

string   $name   —  Elements name to find

[ Top ]

getIterator   [line 365]

HTML_QuickForm2_ContainerIterator getIterator( )

Returns a recursive iterator for the container elements
  • Access: public

[ Top ]

getJavascriptTriggers   [line 494]

void getJavascriptTriggers( )

  • Access: public

Overrides HTML_QuickForm2_Node::getJavascriptTriggers() (Returns IDs of form fields that should trigger "live" Javascript validation)
[ Top ]

getJavascriptValue   [line 483]

string getJavascriptValue( [bool $inContainer = false])

Returns Javascript code for getting the element's value
  • Access: public

Overrides HTML_QuickForm2_Node::getJavascriptValue() (Returns Javascript code for getting the element's value)

Parameters:

bool   $inContainer   —  Whether it should return a parameter for qf.form.getContainerValue()

[ Top ]

getRawValue   [line 161]

array|null getRawValue( )

Returns the container's value without filters applied

The default implementation for Containers is to return an array with contained elements' values. The array is indexed the same way $_GET and $_POST arrays would be for these elements.

  • Access: public

Overrides HTML_QuickForm2_Node::getRawValue() (Returns the element's value without filters applied)
[ Top ]

getRecursiveIterator   [line 376]

RecursiveIteratorIterator getRecursiveIterator( [int $mode = RecursiveIteratorIterator::SELF_FIRST])

Returns a recursive iterator iterator for the container elements
  • Access: public

Parameters:

int   $mode   —  mode passed to RecursiveIteratorIterator

[ Top ]

getValue   [line 175]

array|null getValue( )

Returns the container's value, possibly with filters applied

The default implementation for Containers is to return an array with contained elements' values. The array is indexed the same way $_GET and $_POST arrays would be for these elements.

  • Access: public

Overrides HTML_QuickForm2_Node::getValue() (Returns the element's value, possibly with filters applied)
[ Top ]

insertBefore   [line 338]

HTML_QuickForm2_Node insertBefore( HTML_QuickForm2_Node $element, [HTML_QuickForm2_Node $reference = null])

Inserts an element in the container

If the reference object is not given, the element will be appended.

  • Return: Inserted element
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Container_Group::insertBefore()
Inserts an element in the container

Parameters:

HTML_QuickForm2_Node   $element   —  Element to insert
HTML_QuickForm2_Node   $reference   —  Reference to insert before

[ Top ]

persistentFreeze   [line 86]

void persistentFreeze( [ $persistent = null])

  • Access: public

Overrides HTML_QuickForm2_Node::persistentFreeze() (Changes the element's persistent freeze behaviour)

Parameters:

   $persistent   — 

[ Top ]

prependsName   [line 101]

bool prependsName( )

Whether container prepends its name to names of contained elements
  • Access: protected

Overridden in child classes as:

HTML_QuickForm2_Container_Group::prependsName()

[ Top ]

removeChild   [line 272]

HTML_QuickForm2_Node removeChild( HTML_QuickForm2_Node $element)

Removes the element from this container

If the reference object is not given, the element will be appended.

  • Return: Removed object
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Container_Group::removeChild()
Removes the element from this container

Parameters:

HTML_QuickForm2_Node   $element   —  Element to remove

[ Top ]

render   [line 459]

HTML_QuickForm2_Renderer render( HTML_QuickForm2_Renderer $renderer)

Renders the container using the given renderer
  • Access: public

Overridden in child classes as:

HTML_QuickForm2::render()
Renders the form using the given renderer
HTML_QuickForm2_Container_Group::render()
Renders the group using the given renderer
HTML_QuickForm2_Element_Hierselect::render()
Renders the hierselect using the given renderer

Parameters:

HTML_QuickForm2_Renderer   $renderer   —  Renderer instance

[ Top ]

setName   [line 70]

void setName( $name)

  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Container_Fieldset::setName()
HTML_QuickForm2_Container_Group::setName()

Overrides HTML_QuickForm2_Node::setName() (Sets the element's name)

Parameters:

   $name   — 

[ Top ]

toggleFrozen   [line 76]

void toggleFrozen( [ $freeze = null])

  • Access: public

Overrides HTML_QuickForm2_Node::toggleFrozen() (Changes the element's frozen status)

Parameters:

   $freeze   — 

[ Top ]

updateValue   [line 399]

void updateValue( )

Called when the element needs to update its value from form's data sources

The default behaviour is just to call the updateValue() methods of contained elements, since default Container doesn't have any value itself

  • Access: protected

Overridden in child classes as:

HTML_QuickForm2_Element_Hierselect::updateValue()
Called when the element needs to update its value from form's data sources
HTML_QuickForm2_Element_Date::updateValue()
Called when the element needs to update its value from form's data sources

Overrides HTML_QuickForm2_Node::updateValue() (Called when the element needs to update its value from form's data sources)
[ Top ]

validate   [line 414]

boolean validate( )

Performs the server-side validation

This method also calls validate() on all contained elements.

  • Return: Whether the container and all contained elements are valid
  • Access: protected

Overridden in child classes as:

HTML_QuickForm2::validate()
Performs the server-side validation

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

__call   [line 439]

HTML_QuickForm2_Node __call( mixed $m, mixed $a, array 2)

Appends an element to the container, creating it first

The element will be created via HTML_QuickForm2_Factory::createElement() and then added via the appendChild() method. The element type is deduced from the method name. This is a convenience method to reduce typing.

  • Return: Added element
  • Throws: HTML_QuickForm2_NotFoundException
  • Throws: HTML_QuickForm2_InvalidArgumentException
  • Access: public

Parameters:

array   2   —  Element-specific data
mixed   $m   —  Element name
mixed   $a   —  Element attributes

[ Top ]

__toString   [line 470]

void __toString( )

  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Container_Group::__toString()
HTML_QuickForm2_Element_Hierselect::__toString()

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:45:01 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright Š PHP Group 2004.