Base XHTML element class.
Base XHTML element class.
This class is extended by all of the XHTML element classes. AnewtXHTMLElement provides functionality shared by all XHTML element classes.
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.
add_class($class_name) ¶Add a class to this element.
The current classes are left as-is.
$class_nameThe class name to add.
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_nameThe class to remove (optional). If not given (or null), all classes are removed.
__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.
$childrenOne or more child nodes (optional).
$attributesAssociative array with element attributes (optional).
$always_render_closing_tag ¶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.
$must_be_empty [protected] ¶Whether this node can contain children.
AnewtXMLDomElement::get_attribute()AnewtXMLDomElement::$node_typeAnewtXMLDomElement::render()AnewtXMLDomElement::has_attribute()AnewtXMLDomElement::set_attribute()AnewtXMLDomElement::get_attributes()AnewtXMLDomElement::append_child_raw()AnewtXMLDomElement::append_child_text()AnewtXMLDomElement::$_attributesAnewtXMLDomElement::remove_attribute()AnewtXMLDomElement::$render_as_blockAnewtXMLDomElement::has_attributes()AnewtXMLDomElement::set_attributes()AnewtXMLDomNode::has_child_nodes()AnewtXMLDomNode::$allowed_attributesAnewtXMLDomNode::$parent_nodeAnewtXMLDomNode::insert_before()AnewtXMLDomNode::$child_nodesAnewtXMLDomNode::$allowed_elementsAnewtXMLDomNode::remove_child()AnewtXMLDomNode::$node_nameAnewtXMLDomNode::$owner_documentAnewtXMLDomNode::append_children()AnewtXMLDomNode::replace_child()AnewtXMLDomNode::append_child()AnewtXMLDomNode::is_same_node()AnewtXMLDomNode::$allows_textAnewtXMLDomNode::__construct()AnewtXMLDomNode::create_for_value()