DOMUtils Class Reference
Detailed Description
DomUtils.
Definition at line 18 of file DOMUtils.php.
Static Public Member Functions | |
static | processHtml ($content, callable $processor) |
static | getChildNodesOfName (\DOMElement $element, $elementName) |
static | getNextSiblingOfType (\DOMElement $element, $elementType) |
static | getInnerHtml (\DOMElement $element) |
static | setInnerHtml (\DOMElement $element, $html) |
static | removeEmptyLines ($html) |
Member Function Documentation
◆ processHtml()
|
static |
Process the given html fragment using the given function.
- Parameters
-
$content Html string $processor Function that accepts a DOMDocument as only parameter
- Returns
- String
Definition at line 25 of file DOMUtils.php.
◆ getChildNodesOfName()
|
static |
Get the child nodes of a given element name.
- Parameters
-
\DOMElement $element $elementName
- Returns
- \DOMNodeList[]
Definition at line 38 of file DOMUtils.php.
◆ getNextSiblingOfType()
|
static |
Get the next sibling of the given element type.
- Parameters
-
$element Reference element $elementType Element type (e.g. XML_ELEMENT_NODE)
- Returns
- \DomElement
Definition at line 54 of file DOMUtils.php.
◆ getInnerHtml()
|
static |
Get the inner html string of an element.
- Parameters
-
\DOMElement $element
- Returns
- String
Definition at line 67 of file DOMUtils.php.
◆ setInnerHtml()
|
static |
Set the inner html string of an element.
- Parameters
-
\DOMElement $element $html
Definition at line 81 of file DOMUtils.php.
◆ removeEmptyLines()
|
static |
Remove double linebreaks and empty paragraphs.
- Parameters
-
$content
- Returns
- String
Definition at line 102 of file DOMUtils.php.