Detailed Description

DomUtils.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

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 processHtml (   $content,
callable  $processor 
)
static

Process the given html fragment using the given function.

Parameters
$contentHtml string
$processorFunction that accepts a DOMDocument as only parameter
Returns
String

Definition at line 25 of file DOMUtils.php.

◆ getChildNodesOfName()

static getChildNodesOfName ( \DOMElement  $element,
  $elementName 
)
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 getNextSiblingOfType ( \DOMElement  $element,
  $elementType 
)
static

Get the next sibling of the given element type.

Parameters
$elementReference element
$elementTypeElement type (e.g. XML_ELEMENT_NODE)
Returns
\DomElement

Definition at line 54 of file DOMUtils.php.

◆ getInnerHtml()

static getInnerHtml ( \DOMElement  $element)
static

Get the inner html string of an element.

Parameters
\DOMElement$element
Returns
String

Definition at line 67 of file DOMUtils.php.

◆ setInnerHtml()

static setInnerHtml ( \DOMElement  $element,
  $html 
)
static

Set the inner html string of an element.

Parameters
\DOMElement$element
$html

Definition at line 81 of file DOMUtils.php.

◆ removeEmptyLines()

static removeEmptyLines (   $html)
static

Remove double linebreaks and empty paragraphs.

Parameters
$content
Returns
String

Definition at line 102 of file DOMUtils.php.