PHP 클래스 pQuery\DomNode

상속: implements pquery\IQuery
파일 보기 프로젝트 열기: tburry/pquery 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$attribute_shorttag boolean Use short tags for attributes? If true, then attributes with values equal to the attribute name will not output the value, e.g. selected="selected" will be selected.
$attributes array Attributes of node
$attributes_ns array Namespace info for attributes
$childClass string Name of the class used for {@link addChild()}
$childClass_ASP string Name of the class used for {@link addASP()}
$childClass_CDATA string Name of the class used for {@link addCDATA()}
$childClass_Comment string Name of the class used for {@link addComment()}
$childClass_Conditional string Name of the class used for {@link addContional()}
$childClass_Doctype string Name of the class used for {@link addDoctype()}
$childClass_Text string Name of the class used for {@link addText()}
$childClass_XML string Name of the class used for {@link addXML()}
$children array Array of child nodes
$filter_map array Function map used for the selector filter
$parent DomNode Parent node, null if none
$parserClass string Name of the parser class
$selectClass string Name of the selector class
$self_close boolean Is node a self closing node? No closing tag if true.
$self_close_str string If self close, then this will be used to close the tag
$tag string Full tag name (including namespace)
$tag_ns array Namespace info for tag

공개 메소드들

메소드 설명
__construct ( string | array $tag, DomNode $parent ) Class constructor
__destruct ( ) Class destructor
__get ( $attribute ) : string Class magic get method, outputs {@link getAttribute()}
__invoke ( string $query = '*' ) : pQuery Class magic invoke method, performs {@link query()}.
__isset ( $attribute ) : boolean Class magic isset method, returns {@link hasAttribute()}
__set ( $attribute, $value ) Class magic set method, performs {@link setAttribute()}
__toString ( ) : string Class toString, outputs {@link $tag}
__unset ( $attribute ) Class magic unset method, performs {@link deleteAttribute()}
addASP ( $tag = '', $text = '', $attributes = [], &$offset = null ) #php5
addAttribute ( string $attr, string $val ) Add new attribute
addCDATA ( $text, &$offset = null ) #php5
addChild ( $tag, &$offset = null ) #php5
addClass ( string | array $className ) Add new class(es)
addComment ( $text, &$offset = null ) #php5
addConditional ( $condition, $hidden = true, &$offset = null ) #php5
addDoctype ( $dtd, &$offset = null ) #php5
addText ( $text, &$offset = null ) #php5
addXML ( $tag = 'xml', $text = '', $attributes = [], &$offset = null ) #php5
after ( $content )
append ( $content )
attr ( $name, $value = null )
attributeCount ( ) : integer Number of attributes
before ( $content )
changeParent ( $to, &$index = null ) #php5
childCount ( boolean $ignore_text_comments = false ) : integer Number of children in node
clear ( ) Deletes all child nodes from node
count ( )
delete ( ) Delete node from parent and clear node
deleteAttribute ( string | integer $attr, string $compare = 'total', boolean $case_sensitive = false ) Delete attribute(s)
deleteChild ( integer | DomNode $child, boolean $soft_delete = false ) Delete a child node
detach ( boolean $move_children_up = false ) Detach node from parent
dumpLocation ( ) : string Returns place in document
findChild ( DomNode $child ) : integer Find node in children
firstChild ( boolean $ignore_text_comments = false ) : DomNode First child node
getAttribute ( string | integer $attr, string $compare = 'total', boolean $case_sensitive = false ) : string | array Gets value(s) of attribute(s)
getAttributeNS ( string | integer $attr, string $compare = 'name', boolean $case_sensitive = false ) : string | array Gets namespace of attribute(s)
getChild ( integer | DomNode $child, boolean $ignore_text_comments = false ) : DomNode Get childnode
getChildrenByAttribute ( string $attribute, string $value, string $mode = 'equals', string $compare = 'total', boolean | integer $recursive = true ) : array Finds children that match a certain attribute
getChildrenByCallback ( callable $callback, boolean | integer $recursive = true, boolean $check_self = false ) : array Finds children using a callback function
getChildrenByClass ( string $class, boolean | integer $recursive = true ) : array Finds all children using class attribute
getChildrenByID ( string $id, boolean | integer $recursive = true ) : array Finds all children using ID attribute
getChildrenByMatch ( $conditions, boolean | integer $recursive = true, boolean $check_self = false, $custom_filters = [] ) : array Finds children using the {$link match()} function
getChildrenByName ( string $name, boolean | integer $recursive = true ) : array Finds all children using name attribute
getChildrenByTag ( string $tag, string $compare = 'total', boolean | integer $recursive = true ) : array Finds children that match a certain tag
getEncoding ( ) : string | boolean Try to determine the encoding of the current tag
getInnerText ( ) : string Similar to JavaScript innerText, will return (html formatted) content
getNamespace ( ) : string Get namespace of node
getNextSibling ( boolean $skip_text_comments = true ) : DomNode Get node next to current
getOuterText ( ) : string Similar to JavaScript outerText, will return full (html formatted) node
getPlainText ( ) : string Similar to JavaScript plainText, will return text in node (and subnodes)
getPlainTextUTF8 ( ) : string Return plaintext taking document encoding into account
getPreviousSibling ( boolean $skip_text_comments = true ) : DomNode Get node previous to current
getRoot ( ) : DomNode Get top parent
getSibling ( integer $offset = 1 ) : DomNode Get sibling node
getTag ( ) : string Get tagname of node (without namespace)
hasAttribute ( $attr, string $compare = 'total', boolean $case_sensitive = false ) : boolean Checks if node has attribute
hasChild ( DomNode $child ) : boolean Checks if node has another node as child
hasClass ( string $className ) : boolean Determine if node has a certain class
hasParent ( DomNode | string $tag = null, boolean $recursive = false ) : boolean Find out if node has (a certain) parent
html ( string | null $value = null ) : string Return html code of node
indent ( ) : integer Calculate indent of node (number of parent tags - 1)
index ( boolean $count_all = true ) : integer Index of node in parent
insertChild ( string | DomNode $tag, $index ) : DomNode Insert childnode
isComment ( ) : boolean Find out if node is comment
isParent ( DomNode | string $tag, boolean $recursive = false ) : boolean Find out if node is parent of a certain tag
isText ( ) : boolean Find out if node is text
isTextOrComment ( ) : boolean Find out if node is text or comment node
lastChild ( boolean $ignore_text_comments = false ) : DomNode Last child node
match ( $conditions, array $match = true, array $custom_filters = [] ) : boolean Checks if node matches certain conditions
move ( $to, &$new_index ) #php5
moveChildren ( $to, &$new_index, $start, $end ) #php5
prepend ( $content = null ) }
prop ( $name, $value = null )
query ( string $query = '*' ) : pquery\IQuery Performs a css query on the node.
remove ( $selector = null )
removeAttr ( $name )
removeClass ( string | array $className ) Remove clas(ses)
replaceWith ( $content )
select ( string $query = '*', integer | boolean $index = false, boolean | integer $recursive = true, boolean $check_self = false ) : DomNode[] | DomNode Performs css query on node
setAttribute ( string | integer $attr, $val, string $compare = 'total', boolean $case_sensitive = false ) Sets value(s) of attribute(s)
setAttributeNS ( string | integer $attr, string $namespace, string $compare = 'name', boolean $case_sensitive = false ) : boolean Sets namespace of attribute(s)
setIndex ( integer $index ) Change index of node in parent
setInnerText ( string $text, HtmlParserBase $parser = null ) : boolean | array Similar to JavaScript innerText, will replace child nodes with new text
setNamespace ( string $ns ) Set namespace of node
setOuterText ( string $text, HtmlParserBase $parser = null ) : boolean | array Similar to JavaScript outerText, will replace node (and child nodes) with new text
setPlainText ( string $text ) Similar to JavaScript plainText, will replace child nodes with new text (literal)
setTag ( string $tag, boolean $with_ns = false ) Set tag (with or without namespace)
tagName ( type $value = null ) : string | DomNode
text ( $value = null )
toString ( boolean $attributes = true, boolean | integer $recursive = true, boolean | integer $content_only = false ) : string Returns the node as string
toggleClass ( $classname, $switch = null )
typeIndex ( ) : integer Index of all similar nodes in parent
unwrap ( )
val ( $value = null )
wrap ( string | DomNode $node, integer $wrap_index, integer $node_index = null ) : DomNode Wrap node
wrapInner ( string | DomNode $node, integer $start, integer $end, integer $wrap_index, integer $node_index = null ) : DomNode Wrap child nodes

보호된 메소드들

메소드 설명
createNode ( string | DomNode $content ) : DomNode Create a {@link DomNode} from its string representation.
createNodes ( string | DomNode $content ) : DomNode[] Create an array of {@link DomNode} objects from their string representation.
filter_checked ( ) : boolean Checks if a node matches css query filter ":checked"
filter_comment ( ) : boolean Checks if node matches css query filter ":comment"
filter_contains ( string $text ) : boolean Checks if node matches css query filter ":contains(s)"
filter_element ( ) : boolean Checks if node matches css query filter ":element"
filter_empty ( ) : boolean Checks if node matches css query filter ":empty"
filter_even ( ) : boolean Checks if node matches css query filter ":even"
filter_every ( $n ) : boolean Checks if node matches css query filter ":every(n)"
filter_first ( ) : boolean Checks if node matches css query filter ":first"
filter_firsttype ( ) : boolean Checks if node matches css query filter ":first-of-type"
filter_gt ( string $n ) : boolean Checks if node matches css query filter ":gt(n)"
filter_has ( string $selector ) : boolean Checks if node matches css query filter ":has(s)"
filter_hastext ( ) : boolean Checks if node matches css query filter ":has-text"
filter_lang ( string $lang ) : boolean Checks if node matches css query filter ":lang(s)"
filter_last ( ) : boolean Checks if node matches css query filter ":last"
filter_lasttype ( ) : boolean Checks if node matches css query filter ":last-of-type"
filter_lt ( string $n ) : boolean Checks if node matches css query filter ":lt(n)"
filter_nchild ( string $n ) : boolean Checks if node matches css query filter ":nth-child(n)"
filter_nlastchild ( string $n ) : boolean Checks if node matches css query filter ":nth-last-child(n)"
filter_nlastype ( string $n ) : boolean Checks if node matches css query filter ":nth-last-of-type(n)"
filter_not ( string $selector ) : boolean Checks if node matches css query filter ":not(s)"
filter_notempty ( ) : boolean Checks if node matches css query filter ":not-empty"
filter_notext ( ) : boolean Checks if node matches css query filter ":no-text"
filter_ntype ( string $n ) : boolean Checks if node matches css query filter ":nth-of-type(n)"
filter_odd ( ) : boolean Checks if node matches css query filter ":odd"
filter_onlychild ( ) : boolean Checks if node matches css query filter ":only-child"
filter_onlytype ( ) : boolean Checks if node matches css query filter ":only-of-type"
filter_root ( ) : boolean Checks if node matches css query filter ":root"
filter_selected ( ) : boolean Checks if a node matches css query filter ":selected"
filter_text ( ) : boolean Checks if node matches css query filter ":text"
findAttribute ( string | integer $attr, string $compare = 'total', boolean $case_sensitive = false ) : array Find attribute using namespace, name or both
match_attributes ( array $attributes ) : boolean Checks if attributes match certain conditions
match_filters ( $conditions, array $custom_filters = [] ) : boolean Checks if node matches certain filters
match_tags ( array $tags ) : boolean Checks if tag matches certain conditions
toString_attributes ( ) : string Returns all the attributes and their values
toString_content ( boolean $attributes = true, boolean | integer $recursive = true, boolean $content_only = false ) : string Returns the content of the node (child tags and text)

메소드 상세

__construct() 공개 메소드

Class constructor
public __construct ( string | array $tag, DomNode $parent )
$tag string | array Name of the tag, or array with taginfo (array( 'tag_name' => 'tag', 'self_close' => false, 'attributes' => array('attribute' => 'value')))
$parent DomNode Parent of node, null if none

__destruct() 공개 메소드

Class destructor
public __destruct ( )

__get() 공개 메소드

Class magic get method, outputs {@link getAttribute()}
public __get ( $attribute ) : string
리턴 string

__invoke() 공개 메소드

Class magic invoke method, performs {@link query()}.
public __invoke ( string $query = '*' ) : pQuery
$query string The css query to run on the nodes.
리턴 pQuery

__isset() 공개 메소드

Class magic isset method, returns {@link hasAttribute()}
public __isset ( $attribute ) : boolean
리턴 boolean

__set() 공개 메소드

Class magic set method, performs {@link setAttribute()}
public __set ( $attribute, $value )

__toString() 공개 메소드

Class toString, outputs {@link $tag}
public __toString ( ) : string
리턴 string

__unset() 공개 메소드

Class magic unset method, performs {@link deleteAttribute()}
public __unset ( $attribute )

addASP() 공개 메소드

#php5
public addASP ( $tag = '', $text = '', $attributes = [], &$offset = null )

addAttribute() 공개 메소드

Add new attribute
public addAttribute ( string $attr, string $val )
$attr string
$val string

addCDATA() 공개 메소드

#php5
public addCDATA ( $text, &$offset = null )

addChild() 공개 메소드

#php5
public addChild ( $tag, &$offset = null )

addClass() 공개 메소드

Add new class(es)
public addClass ( string | array $className )
$className string | array

addComment() 공개 메소드

#php5
public addComment ( $text, &$offset = null )

addConditional() 공개 메소드

#php5
public addConditional ( $condition, $hidden = true, &$offset = null )

addDoctype() 공개 메소드

#php5
public addDoctype ( $dtd, &$offset = null )

addText() 공개 메소드

#php5
public addText ( $text, &$offset = null )

addXML() 공개 메소드

#php5
public addXML ( $tag = 'xml', $text = '', $attributes = [], &$offset = null )

after() 공개 메소드

public after ( $content )

append() 공개 메소드

public append ( $content )

attr() 공개 메소드

public attr ( $name, $value = null )

attributeCount() 공개 메소드

Number of attributes
public attributeCount ( ) : integer
리턴 integer

before() 공개 메소드

public before ( $content )

changeParent() 공개 메소드

#php5
public changeParent ( $to, &$index = null )

childCount() 공개 메소드

Number of children in node
public childCount ( boolean $ignore_text_comments = false ) : integer
$ignore_text_comments boolean Ignore text/comments with calculation
리턴 integer

clear() 공개 메소드

Deletes all child nodes from node
public clear ( )

count() 공개 메소드

public count ( )

createNode() 보호된 메소드

Create a {@link DomNode} from its string representation.
protected createNode ( string | DomNode $content ) : DomNode
$content string | DomNode
리턴 DomNode

createNodes() 보호된 메소드

Create an array of {@link DomNode} objects from their string representation.
protected createNodes ( string | DomNode $content ) : DomNode[]
$content string | DomNode
리턴 DomNode[]

delete() 공개 메소드

Delete node from parent and clear node
public delete ( )

deleteAttribute() 공개 메소드

Delete attribute(s)
public deleteAttribute ( string | integer $attr, string $compare = 'total', boolean $case_sensitive = false )
$attr string | integer Negative int to count from end
$compare string Find node using "namespace", "name" or "total"
$case_sensitive boolean Compare with case sensitivity

deleteChild() 공개 메소드

Delete a child node
public deleteChild ( integer | DomNode $child, boolean $soft_delete = false )
$child integer | DomNode Child(index) to delete, negative to count from end
$soft_delete boolean False to call {@link delete()} from child

detach() 공개 메소드

Detach node from parent
또한 보기: delete()
public detach ( boolean $move_children_up = false )
$move_children_up boolean Only detach current node and replace it with child nodes

dumpLocation() 공개 메소드

Returns place in document
public dumpLocation ( ) : string
리턴 string

filter_checked() 보호된 메소드

Checks if a node matches css query filter ":checked"
또한 보기: match()
protected filter_checked ( ) : boolean
리턴 boolean

filter_comment() 보호된 메소드

Checks if node matches css query filter ":comment"
또한 보기: match()
protected filter_comment ( ) : boolean
리턴 boolean

filter_contains() 보호된 메소드

Checks if node matches css query filter ":contains(s)"
또한 보기: match()
protected filter_contains ( string $text ) : boolean
$text string
리턴 boolean

filter_element() 보호된 메소드

Checks if node matches css query filter ":element"
또한 보기: match()
protected filter_element ( ) : boolean
리턴 boolean

filter_empty() 보호된 메소드

Checks if node matches css query filter ":empty"
또한 보기: match()
protected filter_empty ( ) : boolean
리턴 boolean

filter_even() 보호된 메소드

Checks if node matches css query filter ":even"
또한 보기: match()
protected filter_even ( ) : boolean
리턴 boolean

filter_every() 보호된 메소드

Checks if node matches css query filter ":every(n)"
또한 보기: match()
protected filter_every ( $n ) : boolean
리턴 boolean

filter_first() 보호된 메소드

Checks if node matches css query filter ":first"
또한 보기: match()
protected filter_first ( ) : boolean
리턴 boolean

filter_firsttype() 보호된 메소드

Checks if node matches css query filter ":first-of-type"
또한 보기: match()
protected filter_firsttype ( ) : boolean
리턴 boolean

filter_gt() 보호된 메소드

Checks if node matches css query filter ":gt(n)"
또한 보기: match()
protected filter_gt ( string $n ) : boolean
$n string 0-based index
리턴 boolean

filter_has() 보호된 메소드

Checks if node matches css query filter ":has(s)"
또한 보기: match()
protected filter_has ( string $selector ) : boolean
$selector string
리턴 boolean

filter_hastext() 보호된 메소드

Checks if node matches css query filter ":has-text"
또한 보기: match()
protected filter_hastext ( ) : boolean
리턴 boolean

filter_lang() 보호된 메소드

Checks if node matches css query filter ":lang(s)"
또한 보기: match()
protected filter_lang ( string $lang ) : boolean
$lang string
리턴 boolean

filter_last() 보호된 메소드

Checks if node matches css query filter ":last"
또한 보기: match()
protected filter_last ( ) : boolean
리턴 boolean

filter_lasttype() 보호된 메소드

Checks if node matches css query filter ":last-of-type"
또한 보기: match()
protected filter_lasttype ( ) : boolean
리턴 boolean

filter_lt() 보호된 메소드

Checks if node matches css query filter ":lt(n)"
또한 보기: match()
protected filter_lt ( string $n ) : boolean
$n string 0-based index
리턴 boolean

filter_nchild() 보호된 메소드

Checks if node matches css query filter ":nth-child(n)"
또한 보기: match()
protected filter_nchild ( string $n ) : boolean
$n string 1-based index
리턴 boolean

filter_nlastchild() 보호된 메소드

Checks if node matches css query filter ":nth-last-child(n)"
또한 보기: match()
protected filter_nlastchild ( string $n ) : boolean
$n string 1-based index
리턴 boolean

filter_nlastype() 보호된 메소드

Checks if node matches css query filter ":nth-last-of-type(n)"
또한 보기: match()
protected filter_nlastype ( string $n ) : boolean
$n string 1-based index
리턴 boolean

filter_not() 보호된 메소드

Checks if node matches css query filter ":not(s)"
또한 보기: match()
protected filter_not ( string $selector ) : boolean
$selector string
리턴 boolean

filter_notempty() 보호된 메소드

Checks if node matches css query filter ":not-empty"
또한 보기: match()
protected filter_notempty ( ) : boolean
리턴 boolean

filter_notext() 보호된 메소드

Checks if node matches css query filter ":no-text"
또한 보기: match()
protected filter_notext ( ) : boolean
리턴 boolean

filter_ntype() 보호된 메소드

Checks if node matches css query filter ":nth-of-type(n)"
또한 보기: match()
protected filter_ntype ( string $n ) : boolean
$n string 1-based index
리턴 boolean

filter_odd() 보호된 메소드

Checks if node matches css query filter ":odd"
또한 보기: match()
protected filter_odd ( ) : boolean
리턴 boolean

filter_onlychild() 보호된 메소드

Checks if node matches css query filter ":only-child"
또한 보기: match()
protected filter_onlychild ( ) : boolean
리턴 boolean

filter_onlytype() 보호된 메소드

Checks if node matches css query filter ":only-of-type"
또한 보기: match()
protected filter_onlytype ( ) : boolean
리턴 boolean

filter_root() 보호된 메소드

Checks if node matches css query filter ":root"
또한 보기: match()
protected filter_root ( ) : boolean
리턴 boolean

filter_selected() 보호된 메소드

Checks if a node matches css query filter ":selected"
또한 보기: match()
protected filter_selected ( ) : boolean
리턴 boolean

filter_text() 보호된 메소드

Checks if node matches css query filter ":text"
또한 보기: match()
protected filter_text ( ) : boolean
리턴 boolean

findAttribute() 보호된 메소드

Find attribute using namespace, name or both
protected findAttribute ( string | integer $attr, string $compare = 'total', boolean $case_sensitive = false ) : array
$attr string | integer Negative int to count from end
$compare string "namespace", "name" or "total"
$case_sensitive boolean Compare with case sensitivity
리턴 array array('ns', 'attr', 'ns:attr', index)

findChild() 공개 메소드

Find node in children
public findChild ( DomNode $child ) : integer
$child DomNode
리턴 integer False if not found

firstChild() 공개 메소드

First child node
public firstChild ( boolean $ignore_text_comments = false ) : DomNode
$ignore_text_comments boolean Ignore text/comments with index calculation
리턴 DomNode

getAttribute() 공개 메소드

Gets value(s) of attribute(s)
public getAttribute ( string | integer $attr, string $compare = 'total', boolean $case_sensitive = false ) : string | array
$attr string | integer Negative int to count from end
$compare string Find node using "namespace", "name" or "total"
$case_sensitive boolean Compare with case sensitivity
리턴 string | array

getAttributeNS() 공개 메소드

Gets namespace of attribute(s)
public getAttributeNS ( string | integer $attr, string $compare = 'name', boolean $case_sensitive = false ) : string | array
$attr string | integer Negative int to count from end
$compare string Find node using "namespace", "name" or "total"
$case_sensitive boolean Compare with case sensitivity
리턴 string | array False if not found

getChild() 공개 메소드

Get childnode
public getChild ( integer | DomNode $child, boolean $ignore_text_comments = false ) : DomNode
$child integer | DomNode Index, negative to count from end
$ignore_text_comments boolean Ignore text/comments with index calculation
리턴 DomNode

getChildrenByAttribute() 공개 메소드

Finds children that match a certain attribute
public getChildrenByAttribute ( string $attribute, string $value, string $mode = 'equals', string $compare = 'total', boolean | integer $recursive = true ) : array
$attribute string
$value string
$mode string Compare mode, "equals", "|=", "contains_regex", etc.
$compare string "total"/"namespace"/"name"
$recursive boolean | integer
리턴 array

getChildrenByCallback() 공개 메소드

Finds children using a callback function
public getChildrenByCallback ( callable $callback, boolean | integer $recursive = true, boolean $check_self = false ) : array
$callback callable Function($node) that returns a bool
$recursive boolean | integer Check recursively
$check_self boolean Include this node in search?
리턴 array

getChildrenByClass() 공개 메소드

Finds all children using class attribute
public getChildrenByClass ( string $class, boolean | integer $recursive = true ) : array
$class string
$recursive boolean | integer
리턴 array

getChildrenByID() 공개 메소드

Finds all children using ID attribute
public getChildrenByID ( string $id, boolean | integer $recursive = true ) : array
$id string
$recursive boolean | integer
리턴 array

getChildrenByMatch() 공개 메소드

Finds children using the {$link match()} function
public getChildrenByMatch ( $conditions, boolean | integer $recursive = true, boolean $check_self = false, $custom_filters = [] ) : array
$conditions See {$link match()}
$recursive boolean | integer Check recursively
$check_self boolean Include this node in search?
$custom_filters See {$link match()}
리턴 array

getChildrenByName() 공개 메소드

Finds all children using name attribute
public getChildrenByName ( string $name, boolean | integer $recursive = true ) : array
$name string
$recursive boolean | integer
리턴 array

getChildrenByTag() 공개 메소드

Finds children that match a certain tag
public getChildrenByTag ( string $tag, string $compare = 'total', boolean | integer $recursive = true ) : array
$tag string
$compare string "total"/"namespace"/"name"
$recursive boolean | integer
리턴 array

getEncoding() 공개 메소드

Try to determine the encoding of the current tag
public getEncoding ( ) : string | boolean
리턴 string | boolean False if encoding could not be found

getInnerText() 공개 메소드

Similar to JavaScript innerText, will return (html formatted) content
public getInnerText ( ) : string
리턴 string

getNamespace() 공개 메소드

Get namespace of node
또한 보기: setNamespace()
public getNamespace ( ) : string
리턴 string

getNextSibling() 공개 메소드

Get node next to current
또한 보기: getSibling()
또한 보기: getPreviousSibling()
public getNextSibling ( boolean $skip_text_comments = true ) : DomNode
$skip_text_comments boolean
리턴 DomNode Null if not found

getOuterText() 공개 메소드

Similar to JavaScript outerText, will return full (html formatted) node
public getOuterText ( ) : string
리턴 string

getPlainText() 공개 메소드

Similar to JavaScript plainText, will return text in node (and subnodes)
public getPlainText ( ) : string
리턴 string

getPlainTextUTF8() 공개 메소드

Return plaintext taking document encoding into account
public getPlainTextUTF8 ( ) : string
리턴 string

getPreviousSibling() 공개 메소드

Get node previous to current
또한 보기: getSibling()
또한 보기: getNextSibling()
public getPreviousSibling ( boolean $skip_text_comments = true ) : DomNode
$skip_text_comments boolean
리턴 DomNode Null if not found

getRoot() 공개 메소드

Get top parent
public getRoot ( ) : DomNode
리턴 DomNode Root, null if node has no parent

getSibling() 공개 메소드

Get sibling node
public getSibling ( integer $offset = 1 ) : DomNode
$offset integer Offset from current node
리턴 DomNode Null if not found

getTag() 공개 메소드

Get tagname of node (without namespace)
또한 보기: setTag()
public getTag ( ) : string
리턴 string

hasAttribute() 공개 메소드

Checks if node has attribute
public hasAttribute ( $attr, string $compare = 'total', boolean $case_sensitive = false ) : boolean
$compare string Find node using "namespace", "name" or "total"
$case_sensitive boolean Compare with case sensitivity
리턴 boolean

hasChild() 공개 메소드

Checks if node has another node as child
public hasChild ( DomNode $child ) : boolean
$child DomNode
리턴 boolean

hasClass() 공개 메소드

Determine if node has a certain class
public hasClass ( string $className ) : boolean
$className string
리턴 boolean

hasParent() 공개 메소드

Find out if node has (a certain) parent
public hasParent ( DomNode | string $tag = null, boolean $recursive = false ) : boolean
$tag DomNode | string Match against parent, string to match tag, object to fully match node, null to return if node has parent
$recursive boolean
리턴 boolean

html() 공개 메소드

Return html code of node
또한 보기: toString()
public html ( string | null $value = null ) : string
$value string | null The value to set or null to get the value.
리턴 string

indent() 공개 메소드

Calculate indent of node (number of parent tags - 1)
public indent ( ) : integer
리턴 integer

index() 공개 메소드

Index of node in parent
public index ( boolean $count_all = true ) : integer
$count_all boolean True to count all tags, false to ignore text and comments
리턴 integer -1 if not found

insertChild() 공개 메소드

Insert childnode
public insertChild ( string | DomNode $tag, $index ) : DomNode
$tag string | DomNode Tagname or object
리턴 DomNode Added node

isComment() 공개 메소드

Find out if node is comment
public isComment ( ) : boolean
리턴 boolean

isParent() 공개 메소드

Find out if node is parent of a certain tag
또한 보기: hasParent()
public isParent ( DomNode | string $tag, boolean $recursive = false ) : boolean
$tag DomNode | string Match against parent, string to match tag, object to fully match node
$recursive boolean
리턴 boolean

isText() 공개 메소드

Find out if node is text
public isText ( ) : boolean
리턴 boolean

isTextOrComment() 공개 메소드

Find out if node is text or comment node
public isTextOrComment ( ) : boolean
리턴 boolean

lastChild() 공개 메소드

Last child node
public lastChild ( boolean $ignore_text_comments = false ) : DomNode
$ignore_text_comments boolean Ignore text/comments with index calculation
리턴 DomNode

match() 공개 메소드

Checks if node matches certain conditions
public match ( $conditions, array $match = true, array $custom_filters = [] ) : boolean
$match array Should conditions evaluate to true?
$custom_filters array Custom map next to {@link $filter_map}
리턴 boolean

match_attributes() 보호된 메소드

Checks if attributes match certain conditions
또한 보기: match()
protected match_attributes ( array $attributes ) : boolean
$attributes array array('attr' => 'val') or array(array( 'operator_value' => 'equals'/'='/'contains_regex'/etc 'attribute' => 'attr', 'value' => 'val', 'match' => true, 'operator_result' => 'or'/'and', 'compare' => 'total'/'namespace'/'name', 'case_sensitive' => true))
리턴 boolean

match_filters() 보호된 메소드

Checks if node matches certain filters
또한 보기: match()
protected match_filters ( $conditions, array $custom_filters = [] ) : boolean
$custom_filters array Custom map next to {@link $filter_map}
리턴 boolean

match_tags() 보호된 메소드

Checks if tag matches certain conditions
또한 보기: match()
protected match_tags ( array $tags ) : boolean
$tags array array('tag1', 'tag2') or array(array( 'tag' => 'tag1', 'operator' => 'or'/'and', 'compare' => 'total'/'namespace'/'name', 'case_sensitive' => true))
리턴 boolean

move() 공개 메소드

#php5
public move ( $to, &$new_index )

moveChildren() 공개 메소드

#php5
public moveChildren ( $to, &$new_index, $start, $end )

prepend() 공개 메소드

}
public prepend ( $content = null )

prop() 공개 메소드

public prop ( $name, $value = null )

query() 공개 메소드

Performs a css query on the node.
public query ( string $query = '*' ) : pquery\IQuery
$query string
리턴 pquery\IQuery Returns the matching nodes from the query.

remove() 공개 메소드

public remove ( $selector = null )

removeAttr() 공개 메소드

public removeAttr ( $name )

removeClass() 공개 메소드

Remove clas(ses)
public removeClass ( string | array $className )
$className string | array

replaceWith() 공개 메소드

public replaceWith ( $content )

select() 공개 메소드

Performs css query on node
public select ( string $query = '*', integer | boolean $index = false, boolean | integer $recursive = true, boolean $check_self = false ) : DomNode[] | DomNode
$query string
$index integer | boolean True to return node instead of array if only 1 match, false to return array, int to return match at index, negative int to count from end
$recursive boolean | integer
$check_self boolean Include this node in search or only search child nodes
리턴 DomNode[] | DomNode Returns an array of matching {@link DomNode} objects or a single {@link DomNode} if `$index` is not false.

setAttribute() 공개 메소드

Sets value(s) of attribute(s)
public setAttribute ( string | integer $attr, $val, string $compare = 'total', boolean $case_sensitive = false )
$attr string | integer Negative int to count from end
$compare string Find node using "namespace", "name" or "total"
$case_sensitive boolean Compare with case sensitivity

setAttributeNS() 공개 메소드

Sets namespace of attribute(s)
public setAttributeNS ( string | integer $attr, string $namespace, string $compare = 'name', boolean $case_sensitive = false ) : boolean
$attr string | integer Negative int to count from end
$namespace string
$compare string Find node using "namespace", "name" or "total"
$case_sensitive boolean Compare with case sensitivity
리턴 boolean

setIndex() 공개 메소드

Change index of node in parent
public setIndex ( integer $index )
$index integer New index

setInnerText() 공개 메소드

Similar to JavaScript innerText, will replace child nodes with new text
public setInnerText ( string $text, HtmlParserBase $parser = null ) : boolean | array
$text string
$parser HtmlParserBase Null to auto create instance
리턴 boolean | array True on succeed, array with errors on failure

setNamespace() 공개 메소드

Set namespace of node
또한 보기: getNamespace()
public setNamespace ( string $ns )
$ns string

setOuterText() 공개 메소드

Similar to JavaScript outerText, will replace node (and child nodes) with new text
public setOuterText ( string $text, HtmlParserBase $parser = null ) : boolean | array
$text string
$parser HtmlParserBase Null to auto create instance
리턴 boolean | array True on succeed, array with errors on failure

setPlainText() 공개 메소드

Similar to JavaScript plainText, will replace child nodes with new text (literal)
public setPlainText ( string $text )
$text string

setTag() 공개 메소드

Set tag (with or without namespace)
또한 보기: getTag()
public setTag ( string $tag, boolean $with_ns = false )
$tag string
$with_ns boolean Does $tag include namespace?

tagName() 공개 메소드

public tagName ( type $value = null ) : string | DomNode
$value type
리턴 string | DomNode

text() 공개 메소드

public text ( $value = null )

toString() 공개 메소드

Returns the node as string
public toString ( boolean $attributes = true, boolean | integer $recursive = true, boolean | integer $content_only = false ) : string
$attributes boolean Print attributes (of child tags)
$recursive boolean | integer How many sub-levels of child tags to print. True for all.
$content_only boolean | integer Only print text, false will print tags too.
리턴 string

toString_attributes() 보호된 메소드

Returns all the attributes and their values
protected toString_attributes ( ) : string
리턴 string

toString_content() 보호된 메소드

Returns the content of the node (child tags and text)
protected toString_content ( boolean $attributes = true, boolean | integer $recursive = true, boolean $content_only = false ) : string
$attributes boolean Print attributes of child tags
$recursive boolean | integer How many sublevels of childtags to print. True for all.
$content_only boolean Only print text, false will print tags too.
리턴 string

toggleClass() 공개 메소드

public toggleClass ( $classname, $switch = null )

typeIndex() 공개 메소드

Index of all similar nodes in parent
public typeIndex ( ) : integer
리턴 integer -1 if not found

unwrap() 공개 메소드

public unwrap ( )

val() 공개 메소드

public val ( $value = null )

wrap() 공개 메소드

Wrap node
public wrap ( string | DomNode $node, integer $wrap_index, integer $node_index = null ) : DomNode
$node string | DomNode Wrapping node, string to create new element node
$wrap_index integer Index to insert current node in wrapping node, -1 to append
$node_index integer Index to insert wrapping node, null to keep at same position
리턴 DomNode Wrapping node

wrapInner() 공개 메소드

Wrap child nodes
public wrapInner ( string | DomNode $node, integer $start, integer $end, integer $wrap_index, integer $node_index = null ) : DomNode
$node string | DomNode Wrapping node, string to create new element node
$start integer Index from child node where to start wrapping, 0 for first element
$end integer Index from child node where to end wrapping, -1 for last element
$wrap_index integer Index to insert in wrapping node, -1 to append
$node_index integer Index to insert current node, null to keep at same position
리턴 DomNode Wrapping node

프로퍼티 상세

$attribute_shorttag 공개적으로 프로퍼티

Use short tags for attributes? If true, then attributes with values equal to the attribute name will not output the value, e.g. selected="selected" will be selected.
public bool $attribute_shorttag
리턴 boolean

$attributes 공개적으로 프로퍼티

Attributes of node
또한 보기: getAttribute()
또한 보기: setAttribute()
public array $attributes
리턴 array

$attributes_ns 공개적으로 프로퍼티

Namespace info for attributes
또한 보기: findAttribute()
public array $attributes_ns
리턴 array

$childClass 공개적으로 프로퍼티

Name of the class used for {@link addChild()}
public string $childClass
리턴 string

$childClass_ASP 공개적으로 프로퍼티

Name of the class used for {@link addASP()}
public string $childClass_ASP
리턴 string

$childClass_CDATA 공개적으로 프로퍼티

Name of the class used for {@link addCDATA()}
public string $childClass_CDATA
리턴 string

$childClass_Comment 공개적으로 프로퍼티

Name of the class used for {@link addComment()}
public string $childClass_Comment
리턴 string

$childClass_Conditional 공개적으로 프로퍼티

Name of the class used for {@link addContional()}
public string $childClass_Conditional
리턴 string

$childClass_Doctype 공개적으로 프로퍼티

Name of the class used for {@link addDoctype()}
public string $childClass_Doctype
리턴 string

$childClass_Text 공개적으로 프로퍼티

Name of the class used for {@link addText()}
public string $childClass_Text
리턴 string

$childClass_XML 공개적으로 프로퍼티

Name of the class used for {@link addXML()}
public string $childClass_XML
리턴 string

$children 공개적으로 프로퍼티

Array of child nodes
또한 보기: childCount()
또한 보기: getChild()
또한 보기: addChild()
또한 보기: deleteChild()
public array $children
리턴 array

$filter_map 공개적으로 프로퍼티

Function map used for the selector filter
public array $filter_map
리턴 array

$parent 공개적으로 프로퍼티

Parent node, null if none
또한 보기: changeParent()
public DomNode,pquery $parent
리턴 DomNode

$parserClass 공개적으로 프로퍼티

Name of the parser class
또한 보기: setOuterText()
또한 보기: setInnerText()
public string $parserClass
리턴 string

$selectClass 공개적으로 프로퍼티

Name of the selector class
또한 보기: select()
public string $selectClass
리턴 string

$self_close 공개적으로 프로퍼티

Is node a self closing node? No closing tag if true.
public bool $self_close
리턴 boolean

$self_close_str 공개적으로 프로퍼티

If self close, then this will be used to close the tag
public string $self_close_str
리턴 string

$tag 공개적으로 프로퍼티

Full tag name (including namespace)
또한 보기: getTagName()
또한 보기: getNamespace()
public string $tag
리턴 string

$tag_ns 공개적으로 프로퍼티

Namespace info for tag
public array $tag_ns
리턴 array