PHP Class PHPHtmlParser\Dom\HtmlNode

Inheritance: extends InnerNode
Exibir arquivo Open project: paquettg/php-html-parser Class Usage Examples

Protected Properties

Property Type Description
$innerHtml Remembers what the innerHtml was if it was scanned previously.
$outerHtml string Remembers what the outerHtml was if it was scanned previously.
$text string Remembers what the text was if it was scanned previously.
$textWithChildren string Remembers what the text was when we looked into all our children nodes.

Public Methods

Method Description
__construct ( $tag ) Sets up the tag of this node.
innerHtml ( ) : string Gets the inner html of this node.
outerHtml ( ) : string Gets the html of this node, including it's own tag.
text ( boolean $lookInChildren = false ) : string Gets the text of this node (if there is any text). Or get all the text in this node, including children.

Protected Methods

Method Description
clear ( ) Call this when something in the node tree has changed. Like a child has been added or a parent has been changed.
getIteratorArray ( ) : array Returns all children of this html node.

Method Details

__construct() public method

Sets up the tag of this node.
public __construct ( $tag )
$tag

clear() protected method

Call this when something in the node tree has changed. Like a child has been added or a parent has been changed.
protected clear ( )

getIteratorArray() protected method

Returns all children of this html node.
protected getIteratorArray ( ) : array
return array

innerHtml() public method

Gets the inner html of this node.
public innerHtml ( ) : string
return string

outerHtml() public method

Gets the html of this node, including it's own tag.
public outerHtml ( ) : string
return string

text() public method

Gets the text of this node (if there is any text). Or get all the text in this node, including children.
public text ( boolean $lookInChildren = false ) : string
$lookInChildren boolean
return string

Property Details

$innerHtml protected_oe property

Remembers what the innerHtml was if it was scanned previously.
protected $innerHtml

$outerHtml protected_oe property

Remembers what the outerHtml was if it was scanned previously.
protected string $outerHtml
return string

$text protected_oe property

Remembers what the text was if it was scanned previously.
protected string $text
return string

$textWithChildren protected_oe property

Remembers what the text was when we looked into all our children nodes.
protected string $textWithChildren
return string