AnewtXHTMLElement Class Reference

Base XHTML element class. More...

List of all members.

Public Member Functions

Class methods
These methods can be used to manipulate the class attribute of an element. These methods are here for convenience only, since the attributes methods of the AnewtXMLDomElement class van be used as well to set the value of the class attribute.

 set_class ($class_name)
 Set a class for this element.
 add_class ($class_name)
 Add a class to this element.
 remove_class ($class_name=null)
 Remove class attribute(s) from this element.

Public Attributes

 $always_render_closing_tag = true
 Whether the closing tag for this element should always be rendered in full instead of using shorthand notation.

Protected Member Functions

 __construct ($children=null, $attributes=null)
 Create a new XHTML element.

Protected Attributes

 $must_be_empty = false
 Whether this node can contain children.


Detailed Description

Base XHTML element class.

This class is extended by all of the XHTML element classes. AnewtXHTMLElement provides functionality shared by all XHTML element classes.

Definition at line 59 of file xhtml/base.lib.php.


Constructor & Destructor Documentation

AnewtXHTMLElement::__construct ( children = null,
attributes = null 
) [protected]

Create a new XHTML element.

This constructor accepts a variable number of arguments. Each argument is appended as a child node, but the last argument is handled differently. If the last argument is an associative array, its values are used as attribute names and values. If it's not an associative array, it is treated just as the other arguments and appended as a child node.

The AnewtXHTMLElement class is abstract and cannot be instantiated directly. Use one of its descendants instead (all XHTML element classes extend AnewtXHTMLElement); there is one class for each XHTML element in the HTML specification.

Parameters:
$children One or more child nodes (optional).
$attributes Associative array with element attributes (optional).

Reimplemented from AnewtXMLDomElement.

Definition at line 89 of file xhtml/base.lib.php.


Member Function Documentation

AnewtXHTMLElement::set_class ( class_name  ) 

Set a class for this element.

Parameters:
$class_name The class name to set.

Definition at line 128 of file xhtml/base.lib.php.

AnewtXHTMLElement::add_class ( class_name  ) 

Add a class to this element.

The current classes are left as-is.

Parameters:
$class_name The class name to add.

Definition at line 142 of file xhtml/base.lib.php.

AnewtXHTMLElement::remove_class ( class_name = null  ) 

Remove class attribute(s) from this element.

If no parameters are specified, the class attribute is removed.

If a class name is provided, it will be removed from the current classes of this element. If the provided class name was not set on this element, nothing happens.

Parameters:
$class_name The class to remove (optional). If not given (or null), all classes are removed.

Definition at line 171 of file xhtml/base.lib.php.


Member Data Documentation

AnewtXHTMLElement::$always_render_closing_tag = true

Whether the closing tag for this element should always be rendered in full instead of using shorthand notation.

This is needed for e.g. the script tag in XHTML because of browser imcompatibilities.

Reimplemented from AnewtXMLDomElement.

Reimplemented in AnewtXHTMLInput, AnewtXHTMLButton, AnewtXHTMLLink, AnewtXHTMLBase, AnewtXHTMLImage, AnewtXHTMLMeta, and AnewtXHTMLBreak.

Definition at line 64 of file xhtml/base.lib.php.


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

Generated on Sun Aug 2 22:54:38 2009 for Anewt by  doxygen 1.5.9