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. | |
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.
| 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.
| $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.
| AnewtXHTMLElement::set_class | ( | $ | class_name | ) |
Set a class for this element.
| $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.
| $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.
| $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.
| 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.
1.5.9