Method |
Description |
|
__construct ( DOMNode | string $name, string $value = null, array $attributes = [] ) |
Constructor. |
|
__get ( string $name ) : string | null |
Dynamically access the element's attributes. |
|
__invoke ( string $expression, string $type = Query::TYPE_CSS, boolean $wrapElement = true ) : Element[] | DOMElement[] |
Searches for an node in the DOM tree for a given XPath expression or a CSS selector. |
|
__isset ( string $name ) : boolean |
Determine if an attribute exists on the element. |
|
__set ( string $name, mixed $value ) : Element |
Dynamically set an attribute on the element. |
|
__toString ( ) : string |
Convert the element to its string representation. |
|
__unset ( string $name ) |
Unset an attribute on the model. |
|
appendChild ( Element | DOMNode | array $nodes ) : Element |
Adds new child at the end of the children. |
|
attr ( string $name, string $value = null ) : string | null | Element |
Alias for getAttribute and setAttribute methods. |
|
attributes ( ) : array | null |
Returns the node attributes or null, if it is not DOMElement. |
|
child ( $index ) : Element | null |
|
|
children ( ) : Element[] |
|
|
cloneNode ( boolean $deep = true ) : Element |
Clones a node. |
|
closest ( string $selector, boolean $strict = false ) : Element | null |
Returns first parent node matches passed selector. |
|
count ( string $expression, string $type = Query::TYPE_CSS ) : integer |
Counts nodes for a given XPath expression or a CSS selector. |
|
create ( DOMNode | string $name, string $value = null, array $attributes = [] ) : Element |
Create new element. |
|
createBySelector ( string $selector, string $value = null, array $attributes = [] ) : Element |
Create new element node by CSS selector. |
|
find ( string $expression, string $type = Query::TYPE_CSS, boolean $wrapElement = true ) : Element[] | DOMElement[] |
Searches for an node in the DOM tree for a given XPath expression or a CSS selector. |
|
first ( string $expression, string $type = Query::TYPE_CSS, boolean $wrapElement = true ) : Element | DOMElement | null |
Searches for an node in the DOM tree and returns first element or null. |
|
firstChild ( ) : Element | null |
|
|
getAttribute ( string $name, string $default = null ) : string | null |
Access to the element's attributes. |
|
getDocument ( ) : Document | null |
Returns the document associated with this node. |
|
getLineNo ( ) : integer |
Get line number for a node. |
|
getNode ( ) : DOMNode |
Get current \DOMNode instance. |
|
has ( string $expression, string $type = Query::TYPE_CSS ) : boolean |
Checks the existence of the node. |
|
hasAttribute ( string $name ) : boolean |
Determine if an attribute exists on the element. |
|
html ( integer $options = LIBXML_NOEMPTYTAG ) : string |
Dumps the node into a string using HTML formatting. |
|
innerHtml ( integer $options = LIBXML_NOEMPTYTAG, sting $delimiter = '' ) : string |
Dumps the node descendants into a string using HTML formatting. |
|
is ( Element | DOMNode $node ) : boolean |
Indicates if two nodes are the same node. |
|
isCommentNode ( ) : boolean |
Returns true if current node is comment. |
|
isTextNode ( ) : boolean |
Returns true if current node is text. |
|
lastChild ( ) : Element | null |
|
|
matches ( string $selector, boolean $strict = false ) : boolean |
Checks that the node matches selector. |
|
nextSibling ( ) : Element | null |
|
|
parent ( ) : Element | Document | null |
|
|
previousSibling ( ) : Element | null |
|
|
remove ( ) : Element |
Removes child from list of children. |
|
removeAttribute ( string $name ) : Element |
Unset an attribute on the element. |
|
replace ( $newNode, boolean $clone = true ) : Element |
Replaces a child. |
|
setAttribute ( string $name, string $value ) : Element |
Set an attribute on the element. |
|
setInnerHtml ( string $html ) : Element |
Sets inner HTML. |
|
setValue ( string $value ) : Element |
Set the value of this node. |
|
text ( ) : string |
Get the text content of this node and its descendants. |
|
toDocument ( string $encoding = 'UTF-8' ) : Document |
Get the DOM document with the current element. |
|
xml ( integer $options ) : string |
Dumps the node into a string using XML formatting. |
|
xpath ( string $expression, boolean $wrapElement = true ) : Element[] | DOMElement[] |
Searches for an node in the DOM tree for a given XPath expression. |
|