PHP 클래스 PHPHtmlParser\Dom\AbstractNode

파일 보기 프로젝트 열기: paquettg/php-html-parser 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$attr array Contains a list of attributes on this tag.
$encode mixed The encoding class used to encode strings.
$id string The unique id of the class. Given by PHP.
$parent InnerNode Contains the parent Node.
$tag Tag Contains the tag name/type

공개 메소드들

메소드 설명
__construct ( ) Creates a unique spl hash for this node.
__destruct ( ) Attempts to clear out any object references.
__get ( string $key ) : mixed Magic get method for attributes and certain methods.
__toString ( ) : string Simply calls the outer text method.
ancestorByTag ( string $tag ) : AbstractNode Function to locate a specific ancestor tag in the path to the root.
delete ( ) : void Removes this node and all its children from the DOM tree.
find ( string $selector, integer $nth = null ) : array | AbstractNode Find elements by css selector
getAncestor ( integer $id ) : null | AbstractNode Attempts to get an ancestor node by the given id.
getAttribute ( string $key ) : mixed A wrapper method that simply calls the getAttribute method on the tag of this node.
getAttributes ( ) : array A wrapper method that simply calls the getAttribute method on the tag of this node.
getParent ( ) : AbstractNode Returns the parent of node.
getTag ( ) : Tag Gets the tag object of this node.
id ( ) Returns the id of this object.
innerHtml ( ) : string Gets the inner html of this node.
isAncestor ( integer $id ) : boolean Checks if the given node id is an ancestor of the current node.
nextSibling ( ) : AbstractNode Attempts to get the next sibling.
outerHtml ( ) : string Gets the html of this node, including it's own tag.
previousSibling ( ) : AbstractNode Attempts to get the previous sibling
propagateEncoding ( stringEncode\Encode $encode ) : void Sets the encoding class to this node.
removeAllAttributes ( ) : void A wrapper method that simply calls the removeAllAttributes method on the tag of this node.
removeAttribute ( string $key ) : void A wrapper method that simply calls the removeAttribute method on the tag of this node.
setAttribute ( string $key, string $value ) A wrapper method that simply calls the setAttribute method on the tag of this node.
setParent ( InnerNode $parent ) Sets the parent node.
text ( ) : string Gets the text of this node (if there is any text).

보호된 메소드들

메소드 설명
clear ( ) : void Call this when something in the node tree has changed. Like a child has been added or a parent has been changed.

메소드 상세

__construct() 공개 메소드

Creates a unique spl hash for this node.
public __construct ( )

__destruct() 공개 메소드

Attempts to clear out any object references.
public __destruct ( )

__get() 공개 메소드

Magic get method for attributes and certain methods.
public __get ( string $key ) : mixed
$key string
리턴 mixed

__toString() 공개 메소드

Simply calls the outer text method.
public __toString ( ) : string
리턴 string

ancestorByTag() 공개 메소드

Function to locate a specific ancestor tag in the path to the root.
public ancestorByTag ( string $tag ) : AbstractNode
$tag string
리턴 AbstractNode

clear() 추상적인 보호된 메소드

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

delete() 공개 메소드

Removes this node and all its children from the DOM tree.
public delete ( ) : void
리턴 void

find() 공개 메소드

Find elements by css selector
public find ( string $selector, integer $nth = null ) : array | AbstractNode
$selector string
$nth integer
리턴 array | AbstractNode

getAncestor() 공개 메소드

Attempts to get an ancestor node by the given id.
public getAncestor ( integer $id ) : null | AbstractNode
$id integer
리턴 null | AbstractNode

getAttribute() 공개 메소드

A wrapper method that simply calls the getAttribute method on the tag of this node.
public getAttribute ( string $key ) : mixed
$key string
리턴 mixed

getAttributes() 공개 메소드

A wrapper method that simply calls the getAttribute method on the tag of this node.
public getAttributes ( ) : array
리턴 array

getParent() 공개 메소드

Returns the parent of node.
public getParent ( ) : AbstractNode
리턴 AbstractNode

getTag() 공개 메소드

Gets the tag object of this node.
public getTag ( ) : Tag
리턴 Tag

id() 공개 메소드

Returns the id of this object.
public id ( )

innerHtml() 추상적인 공개 메소드

Gets the inner html of this node.
abstract public innerHtml ( ) : string
리턴 string

isAncestor() 공개 메소드

Checks if the given node id is an ancestor of the current node.
public isAncestor ( integer $id ) : boolean
$id integer
리턴 boolean

nextSibling() 공개 메소드

Attempts to get the next sibling.
public nextSibling ( ) : AbstractNode
리턴 AbstractNode

outerHtml() 추상적인 공개 메소드

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

previousSibling() 공개 메소드

Attempts to get the previous sibling
public previousSibling ( ) : AbstractNode
리턴 AbstractNode

propagateEncoding() 공개 메소드

Sets the encoding class to this node.
public propagateEncoding ( stringEncode\Encode $encode ) : void
$encode stringEncode\Encode
리턴 void

removeAllAttributes() 공개 메소드

A wrapper method that simply calls the removeAllAttributes method on the tag of this node.
public removeAllAttributes ( ) : void
리턴 void

removeAttribute() 공개 메소드

A wrapper method that simply calls the removeAttribute method on the tag of this node.
public removeAttribute ( string $key ) : void
$key string
리턴 void

setAttribute() 공개 메소드

A wrapper method that simply calls the setAttribute method on the tag of this node.
public setAttribute ( string $key, string $value )
$key string
$value string

setParent() 공개 메소드

Sets the parent node.
public setParent ( InnerNode $parent )
$parent InnerNode

text() 추상적인 공개 메소드

Gets the text of this node (if there is any text).
abstract public text ( ) : string
리턴 string

프로퍼티 상세

$attr 보호되어 있는 프로퍼티

Contains a list of attributes on this tag.
protected array $attr
리턴 array

$encode 보호되어 있는 프로퍼티

The encoding class used to encode strings.
protected mixed $encode
리턴 mixed

$id 보호되어 있는 프로퍼티

The unique id of the class. Given by PHP.
protected string $id
리턴 string

$parent 보호되어 있는 프로퍼티

Contains the parent Node.
protected InnerNode,PHPHtmlParser\Dom $parent
리턴 InnerNode

$tag 보호되어 있는 프로퍼티

Contains the tag name/type
protected Tag,PHPHtmlParser\Dom $tag
리턴 Tag