Detailed Description

behold: the ├╝ber-class

The abstract element class contains the basic attributes and tools of container and input elements.

Definition at line 20 of file element.php.

Inheritance diagram for element:

Public Member Functions

 __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...
 

Data Fields

 $valid
 Contains element validation status/result. More...
 

Protected Member Functions

 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

 $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 
)

element class constructor

Parameters
string$nameelement name
array$parameterselement parameters, HTML attributes
object$formparent form object reference
Returns
void

Definition at line 47 of file element.php.

Member Function Documentation

__call (   $function,
  $arguments 
)

HTML escaping.

Returns respective HTML escaped attributes for element rendering. Has to be called before printing user-entered data.

Parameters
string$functionfunction name
array$argumentsfunction arguments
Returns
mixed HTML escaped value
See Also
htmlEscape()

Definition at line 88 of file element.php.

checkParameters (   $parameters)
protected

checks element parameters

Throws an exception if $parameters isn't of type array.

Parameters
array$parametersparameters for element constructor
Returns
void

Definition at line 131 of file element.php.

clearValue ( )

resets the value to null

This needs to be refined in the subclasses which really provide an input. It is defined on this abstract class since clearSession calls it for every element in the form even if there is no value.

Returns
void

Definition at line 109 of file element.php.

getName ( )

Returns the element name.

Returns
string $this->name element name

Definition at line 118 of file element.php.

htmlEscape (   $options = array())
protected

Escapes HTML in strings and arrays of strings.

Parameters
mixed$optionsvalue to be HTML-escaped
Returns
mixed $htmlOptions HTML escaped value
See Also
__call()

Definition at line 193 of file element.php.

log (   $argument,
  $type = null 
)
protected

error & warning logger

If the element is constructed with a custom log object the logging happens there, otherwise the PHP error_log function is used.

Parameters
string$argumentmessage
string$typetype of log message
Returns
void

Definition at line 168 of file element.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 70 of file element.php.

Field Documentation

$log
protected

Log object reference.

Definition at line 37 of file element.php.

$name
protected

Element name.

Definition at line 25 of file element.php.

$valid

Contains element validation status/result.

Definition at line 29 of file element.php.

$validated = false
protected

True if the element has been validated before.

Definition at line 33 of file element.php.


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