Element

Node representing an HTML element. Class Element
implements Countable , IteratorAggregate , SDom\Node\NodeInterface , Traversable
Methods Summary
public
# __construct( string $tag )
Element constructor.
public
# __toString( )

inheritDoc


Implementation of

public
# __clone( )

inheritDoc


Implementation of

public
# getTag( )
Retrieve the tag name of the element.
public
# hasAttribute( string $name )
Return TRUE if the specified name exists as attribute. The attribute name is lowercased.
public
# setAttribute( string $name , string $value = '' )
Set the specified value for the specified attribute name. Attributes with no value, or an empty string as value are rendered without the ="..." part. The attribute name is lowercased.
public
# getAttribute( string $name )
Retrieve the value of the specified attribute name, or NULL if the attribute does not exist. The attribute name is lowercased.
public
# removeAttribute( string $name )
Remove an attribute with the specified name. The attribute name is lowercased.
public
# parent( )

inheritDoc


Implementation of

public
public
# detach( )

inheritDoc


Implementation of

public
# clone( )

inheritDoc


Implementation of

public
# getIterator( )

inheritDoc


Implementation of

public
# count( )

inheritDoc


Implementation of

public
# insertAfter( SDom\Node\NodeInterface $node , SDom\Node\NodeInterface $after = NULL )
Insert content at the end of the list of child nodes, or after the specified target node. If the target node is not an immediate child node of this one, an exception will be thrown. Attach this node as parent to the inserted node.
public
# insertBefore( SDom\Node\NodeInterface $node , SDom\Node\NodeInterface $before = NULL )
Insert content at the beginning of the list of child nodes, or before the specified target node. If the target node is not an immediate child node of this one, an exception will be thrown. Attach this node as parent to the inserted node.
public
# isChild( SDom\Node\NodeInterface $node )
Returns TRUE if the specified node is an immediate child of the current node.
public
# get( int $index )
Retrieve a NodeInterface instance (immediate child node) for the specified index. Throw \OutOfBoundsException exception if the specified index is out of bounds.
public
# index( SDom\Node\NodeInterface $node )
Retrieve the positional index of the specified NodeInterface in the list of immediate child nodes. If the target node is not an immediate child node of this one, an exception will be thrown.
public
# removeChild( SDom\Node\NodeInterface $node )
Remove the specified node from the list of immediate children of this node. If the target node is not an immediate child node of this one, an exception will be thrown. The node's detach() method will also be called to release the parent reference if such is set.
public
# clear( )
Remove all child nodes.
public
# isVoid( )
Returns TRUE if the element's tag matches the list of void element tags.
Properties Summary
protected static string[] $void

# array ( 0 => 'area', 1 => 'base', 2 => 'br', 3 => 'col', 4 => 'embed', 5 => 'hr', 6 => 'img', 7 => 'input', 8 => 'link', 9 => 'meta', 10 => 'param', 11 => 'source', 12 => 'track', 13 => 'wbr', )
protected string $tag

# NULL
protected SDom\Node\Element $parent

# NULL
protected string[] $attributes

# array ( )
protected \SDom\Node\NodeInterface[] $children

# array ( )