Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

XHTMLElement Class Reference

Inheritance diagram for XHTMLElement:

Inheritance graph
List of all members.

Detailed Description

A XHTML conformant XML element.

This class provides a means to produce an XML element that is XHTML conformant. As such it provides methods to manage element attributes as well as providing for an element name.

Objects created from this class are session safe, meaning that they can be serialised and unserialised without loosing state.

Warning:
this class does not enforce XHTML compliancy.

Definition at line 101 of file controls.php.

Public Member Functions

 XHTMLElement ($name)
 The XHTMLElement constructor.

 getElementName ()
 Get the element name.

 getAttribute ($name)
 Get an attribute value.

 setAttribute ($name, $value)
 Set an attribute.

 setBooleanAttribute ($name, $state)
 Set a boolean attribute.

 hasAttribute ($name)
 Check whether an attribute exists.

 removeAttribute ($name)
 Remove an attribute.

 toXHTML ()
 Serialise the object to an XHTML string.

 toString ()
 Get a human readable string representation of the element.

 __sleep ()
 Prepare object for serialisation.

 __wakeup ()
 Initialise object after unserialisation.


Public Attributes

 $dom_document
 A DOM XML document with which to create elements.

 $node
 The DOM XML node representing the current element.

 $serialise
 A string to which the node is serialised as XML when the object is serialised.


Constructor & Destructor Documentation

XHTMLElement::XHTMLElement name  ) 
 

The XHTMLElement constructor.

Parameters:
$name the name of the XHTML element

Definition at line 114 of file controls.php.


Member Function Documentation

XHTMLElement::__sleep  ) 
 

Prepare object for serialisation.

This method is automatically called just before the object is serialised to carry out clean-up operations. See the PHP documentation at http://www.php.net/manual/en/language.oop.magic-functions.php for more information.

Returns:
an array of object property names to be serialised.

Reimplemented in ControlElement, EnhancedImageInput, Option, CheckedInput, and SelectElement.

Definition at line 221 of file controls.php.

XHTMLElement::__wakeup  ) 
 

Initialise object after unserialisation.

This method is automatically called just after the object is unserialised and ensures it is properly initialised. See the PHP documentation at http://www.php.net/manual/en/language.oop.magic-functions.php for more information.

Returns:
void

Reimplemented in ControlElement, FileInput, and SelectElement.

Definition at line 236 of file controls.php.

XHTMLElement::getAttribute name  ) 
 

Get an attribute value.

Parameters:
$name the name of the attribute to retrieve
Returns:
the attribute value as a string

Definition at line 135 of file controls.php.

XHTMLElement::getElementName  ) 
 

Get the element name.

Returns:
the element name as a string

Definition at line 125 of file controls.php.

XHTMLElement::hasAttribute name  ) 
 

Check whether an attribute exists.

Parameters:
$name the name of the attribute
Returns:
true of the attribute exists, false otherwise

Definition at line 170 of file controls.php.

XHTMLElement::removeAttribute name  ) 
 

Remove an attribute.

Parameters:
$name the name of the attribute
Returns:
true if the attribute was successfully removed, false otherwise

Definition at line 180 of file controls.php.

XHTMLElement::setAttribute name,
value
 

Set an attribute.

Parameters:
$name the name of the attribute
$value the value of the attribute
Returns:
void

Reimplemented in SelectElement.

Definition at line 146 of file controls.php.

XHTMLElement::setBooleanAttribute name,
state
 

Set a boolean attribute.

Parameters:
$name the name of the attribute
$state true or false
Returns:
void

Definition at line 157 of file controls.php.

XHTMLElement::toString  ) 
 

Get a human readable string representation of the element.

Returns:
string

Reimplemented in CheckedInput, CheckboxInput, and MultipleSelect.

Definition at line 203 of file controls.php.

XHTMLElement::toXHTML  ) 
 

Serialise the object to an XHTML string.

Returns:
the XHTML string

Reimplemented in SelectElement.

Definition at line 189 of file controls.php.


Member Data Documentation

XHTMLElement::$dom_document
 

A DOM XML document with which to create elements.

Definition at line 104 of file controls.php.

XHTMLElement::$node
 

The DOM XML node representing the current element.

Definition at line 106 of file controls.php.

XHTMLElement::$serialise
 

A string to which the node is serialised as XML when the object is serialised.

Definition at line 108 of file controls.php.


The documentation for this class was generated from the following file:
Generated on Mon Feb 14 11:39:54 2005 for FormControls by doxygen 1.3.5