Detailed Description

container element base class

The abstract container class contains the base for container type elements. ie. htmlform, fieldset and step

Definition at line 21 of file container.php.

Inheritance diagram for container:

Public Member Functions

 __construct ($name, $parameters, $form)
 container class constructor More...
 
 __call ($function, $arguments)
 HTML escaping and add subelements. More...
 
 addChildElements ()
 Sub-element generator hook. More...
 
 addHtml ($html)
 Adds a new custom HTML element to the container. More...
 
 addStepNav ($parameter=array())
 Adds automatic step navigation to output. More...
 
 validate ()
 Validates container and its contents. More...
 
 setRequired ($required=true)
 Sets required-attribute. More...
 
 getElements ($includeFieldsets=false)
 Returns containers subelements. More...
 
 getElement ($name)
 Gets subelement by name. More...
 
 clearValue ()
 Deletes values of all child elements. More...
 
- Public Member Functions inherited from element
 __construct ($name, $parameters, $form)
 element class constructor More...
 
 __call ($function, $arguments)
 HTML escaping. More...
 
 clearValue ()
 resets the value to null More...
 
 getName ()
 Returns the element name. More...
 

Protected Member Functions

 addElement ($type, $name, $parameters)
 Generates sub-elements. More...
 
- Protected Member Functions inherited from element
 setDefaults ()
 Collects initial values across subclasses. More...
 
 checkParameters ($parameters)
 checks element parameters More...
 
 log ($argument, $type=null)
 error & warning logger More...
 
 htmlEscape ($options=array())
 Escapes HTML in strings and arrays of strings. More...
 

Protected Attributes

 $elements = array()
 References to input elements and fieldsets. More...
 
 $elementsAndHtml = array()
 Input element, fieldset and custom HTML object references. More...
 
 $form
 Parent form object reference. More...
 
- Protected Attributes inherited from element
 $name
 Element name. More...
 
 $validated = false
 True if the element has been validated before. More...
 
 $log
 Log object reference. More...
 

Additional Inherited Members

- Data Fields inherited from element
 $valid
 Contains element validation status/result. More...
 

Constructor & Destructor Documentation

__construct (   $name,
  $parameters,
  $form 
)

container class constructor

Parameters
string$namecontainer name
array$parameterscontainer parameters, HTML attributes
object$formparent form object
Returns
void

Definition at line 44 of file container.php.

Member Function Documentation

__call (   $function,
  $arguments 
)

HTML escaping and add subelements.

  1. (Methods beginning with "add") Calls addElement() with element-specific type argument. Tries to instantiate the respective class.
  2. (Methods beginnning with "html)" Returns the respective HTML escaped attributes for element rendering.
Parameters
string$functionfunction name
array$argumentsfunction arguments
Returns
object element object or (mixed) HTML escaped value
See Also
addElement()
htmlEscape()

Definition at line 67 of file container.php.

addChildElements ( )

Sub-element generator hook.

Adds child elements just after container construction. Can be used for subclasses of the container class to add new elements to itself.

(see depage::htmlform::elements::creditcard for an example implementation)

Returns
void
See Also
addElement()

Definition at line 125 of file container.php.

addElement (   $type,
  $name,
  $parameters 
)
protected

Generates sub-elements.

Adds new child elements to $this->elements.

Parameters
string$typeelememt type
string$nameelement name
array$parameterselement attributes: HTML attributes, validation parameters etc.
Returns
object $newElement new element object
See Also
__call()
addChildElements()

Definition at line 93 of file container.php.

addHtml (   $html)

Adds a new custom HTML element to the container.

Parameters
string$htmlHTML code
Returns
object $htmlElement HTML element object
See Also
depage::htmlform::elements::html

Definition at line 135 of file container.php.

addStepNav (   $parameter = array())

Adds automatic step navigation to output.

Parameters
array$parameterarray of opional parameters

Definition at line 149 of file container.php.

clearValue ( )

Deletes values of all child elements.

Returns
void

Definition at line 264 of file container.php.

getElement (   $name)

Gets subelement by name.

Searches subelements by name and returns a single element object if successful. Returns false if the element can't be found.

Parameters
string$namename of the input element we're looking for
Returns
object $element subelement or (bool) false if unsuccessful

Definition at line 248 of file container.php.

getElements (   $includeFieldsets = false)

Returns containers subelements.

Walks recursively through current containers' elements to compile a list of subelements.

Parameters
bool$includeFieldsetsinclude fieldset/step elements in result
Returns
array $allElements subelements

Definition at line 222 of file container.php.

setRequired (   $required = true)

Sets required-attribute.

Sets current containers' elements' HTML-required attribute recursively.

Parameters
bool$requiredHTML-required attribute
Returns
void

Definition at line 189 of file container.php.

validate ( )

Validates container and its contents.

Walks recursively through current containers' elements and checks if they're valid. Saves the result to $this->valid.

Returns
bool $this->valid validation result

Definition at line 166 of file container.php.

Field Documentation

$elements = array()
protected

References to input elements and fieldsets.

Definition at line 26 of file container.php.

$elementsAndHtml = array()
protected

Input element, fieldset and custom HTML object references.

Definition at line 30 of file container.php.

$form
protected

Parent form object reference.

Definition at line 34 of file container.php.


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