Detailed Description

Default address fieldset.

Class to get user address information. It generates a fieldset that consists of

  • a state
  • a country select

Usage

<?php
$form = new depage\htmlform\htmlform('myform');
// add a creditcard fieldset
$form->addAddress('address', array(
'label' => 'Address',
));
// process form
$form->process();
// Display the form.
echo ($form);

Definition at line 39 of file address.php.

Inheritance diagram for address:

Public Member Functions

 __construct ($name, $parameters, $form)
 multiple class constructor More...
 
 addChildElements ()
 adds address-inputs to fieldset More...
 
 validate ()
 Validate the address data. More...
 
- Public Member Functions inherited from fieldset
 addElement ($type, $name, $parameters)
 Generates sub-elements. More...
 
 __toString ()
 Renders the fieldset to HTML code. More...
 
- Public Member Functions inherited from container
 __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

 setDefaults ()
 collects initial values across subclasses. More...
 
- Protected Member Functions inherited from fieldset
 setDefaults ()
 collects initial values across subclasses. More...
 
 htmlClasses ()
 Returns string of the elements' HTML-classes, separated by spaces. More...
 
- Protected Member Functions inherited from container
 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...
 

Additional Inherited Members

- Data Fields inherited from element
 $valid
 Contains element validation status/result. More...
 
- Protected Attributes inherited from fieldset
 $form
 parent HTML form. More...
 
- Protected Attributes inherited from container
 $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...
 

Constructor & Destructor Documentation

__construct (   $name,
  $parameters,
  $form 
)

multiple class constructor

Parameters
string$nameelement name
array$parameterselement parameters, HTML attributes, validator specs etc.
object$formparent form object
Returns
void

Definition at line 49 of file address.php.

Member Function Documentation

addChildElements ( )

adds address-inputs to fieldset

Returns
void

Definition at line 113 of file address.php.

setDefaults ( )
protected

collects initial values across subclasses.

The constructor loops through these and creates settable class attributes at runtime. It's a compact mechanism for initialising a lot of variables.

Returns
void

Definition at line 95 of file address.php.

validate ( )

Validate the address data.

Returns
bool validation result

Definition at line 172 of file address.php.


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