\ExtDOMElement

ExtDOMElement class.

Adds functionality to PHP's built-in DOMElement class.

Summary

Methods
Properties
Constants
getElementsByClassName()
getInnerHTML()
setInnerHTML()
hasClass()
addClass()
getDatasets()
addDatastack()
getOuterHTML()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

getElementsByClassName()

getElementsByClassName(string  $cls) : \DOMNodeList

Retrieve all child nodes in the node according to a class name.

Parameters

string $cls

The class name.

Returns

\DOMNodeList

getInnerHTML()

getInnerHTML() : string

Retrieve the innerHTML of the node.

Returns

string

setInnerHTML()

setInnerHTML(string  $value) 

Set the innerHTML of the node.

Parameters

string $value

HTML content.

hasClass()

hasClass(string  $cls) : boolean

Detect if the the node has the specified class name.

Parameters

string $cls

The class name.

Returns

boolean —

TRUE on success, FALSE otherwise.

addClass()

addClass(string  $cls) 

Add a class to the node.

Parameters

string $cls

The class name.

getDatasets()

getDatasets() : array

Retrieve the data- attributes from the node.

Returns

array

addDatastack()

addDatastack(string  $key, string  $value) 

Add a key/value pair to the dataset of the node.

Parameters

string $key

The item name.

string $value

The item value.

getOuterHTML()

getOuterHTML() : string

Retrieve the outerHTML of the node.

Returns

string