Method |
Description |
|
__call ( $name, $arguments ) |
Call extension methods. |
|
__clone ( ) |
Clone the DOMQuery. |
|
__construct ( mixed $document = null, string $string = null, array $options = [] ) |
Constructor. |
|
add ( string $selector ) |
Add more elements to the current set of matches. |
|
addClass ( string $class ) |
Add a class to all elements in the current DOMQuery. |
|
after ( mixed $data ) |
Insert the given data after each element in the current DOMQuery object. |
|
andSelf ( ) |
Combine the current and previous set of matched objects. |
|
append ( mixed $data ) |
Insert the given markup as the last child. |
|
appendTo ( DOMQuery $dest ) |
Append the current elements to the destination passed into the function. |
|
attach ( DOMQuery $dest ) |
Attach any items from the list if they match the selector. |
|
attr ( mixed $name = null, string $value = null ) : mixed |
Get/set an attribute. |
|
before ( mixed $data ) |
Insert the given data before each element in the current set of matches. |
|
branch ( string $selector = null ) |
Branch the base DOMQuery into another one with the same matches. |
|
children ( string $selector = null ) |
Get the children of the elements in the DOMQuery object. |
|
childrenText ( string $separator = ' ' ) : string |
Get the text contents from just child elements. |
|
cloneAll ( ) |
Perform a deep clone of each node in the DOMQuery. |
|
closest ( string $selector ) |
Find the closest element matching the selector. |
|
contents ( ) |
Get all child nodes (not just elements) of all items in the matched set. |
|
count ( ) : integer |
Get the number of elements currently wrapped by this object. |
|
css ( mixed $name = null, string $value = '' ) |
Set/get a CSS value for the current element(s). |
|
dataURL ( string $attr, mixed $data = null, string $mime = 'application/octet-stream', resource $context = null ) |
Insert or retrieve a Data URL. |
|
deepest ( ) |
Reduce the set of matches to the deepest child node in the tree. |
|
detach ( string $selector = null ) |
Detach any items from the list if they match the selector. |
|
document ( ) : DOMDocument |
Get the DOMDocument that we currently work with. |
|
each ( callback $callback ) |
Run a callback on each item in the list of items. |
|
eachLambda ( string $lambda ) |
An each() iterator that takes a lambda function. |
|
emptyElement ( ) |
Empty everything within the specified element. |
|
end ( ) |
Revert to the previous set of matches. |
|
eq ( $index ) |
Reduce the matched set to just one. |
|
even ( ) |
Get the even elements, so counter-intuitively 1, 3, 5, etc. |
|
filter ( string $selector ) |
Filter a list down to only elements that match the selector. |
|
filterCallback ( $callback ) |
Filter based on a callback function. |
|
filterLambda ( string $fn ) |
Filter based on a lambda function. |
|
filterPreg ( string $regex ) |
Use regular expressions to filter based on the text content of matched elements. |
|
find ( string $selector ) |
Given a CSS Selector, find matching items. |
|
findInPlace ( $selector ) |
|
|
first ( ) |
Get the first matching element. |
|
firstChild ( ) |
Get the first child of the matching element. |
|
get ( integer $index = null, boolean $asObject = false ) : mixed |
Get one or all elements from this object. |
|
getIterator ( ) : Iterable |
Get an iterator for the matches in this object. |
|
getOptions ( ) : array |
Get the effective options for the current DOMQuery object. |
|
has ( mixed $contained ) |
Reduce the elements matched by DOMQuery to only those which contain the given item. |
|
hasAttr ( string $attrName ) : boolean |
Check to see if the given attribute is present. |
|
hasClass ( string $class ) : boolean |
Returns TRUE if any of the elements in the DOMQuery have the specified class. |
|
html ( string $markup = null ) : mixed |
Set or get the markup for an element. |
|
index ( DOMElement $subject ) : mixed |
Get an item's index. |
|
innerHTML ( ) : string |
Fetch the HTML contents INSIDE of the first DOMQuery item. |
|
innerXHTML ( ) : string |
Fetch child (inner) nodes of the first match. |
|
innerXML ( ) : string |
Fetch child (inner) nodes of the first match. |
|
insertAfter ( DOMQuery $dest ) |
Insert the contents of the current DOMQuery after the nodes in the
destination DOMQuery object. |
|
insertBefore ( DOMQuery $dest ) |
Insert the current elements into the destination document. |
|
is ( string $selector ) : boolean |
Given a selector, this checks to see if the current set has one or more matches. |
|
last ( ) |
Get the last matching element. |
|
lastChild ( ) |
Get the last child of the matching element. |
|
map ( callback $callback ) |
Run a function on each item in a set. |
|
next ( string $selector = null ) |
Get the next sibling of each element in the DOMQuery. |
|
nextAll ( string $selector = null ) |
Get all siblings after an element. |
|
nextUntil ( string $selector = null ) |
Get all siblings after an element until the selector is reached. |
|
not ( string $selector ) |
Filter a list to contain only items that do NOT match. |
|
odd ( ) |
Get the odd elements, so counter-intuitively 0, 2, 4, etc. |
|
parent ( string $selector = null ) |
Get the immediate parent of each element in the DOMQuery. |
|
parents ( string $selector = null ) |
Get all ancestors of each element in the DOMQuery. |
|
parentsUntil ( string $selector = null ) |
Get all ancestors of each element in the DOMQuery until the selector is reached. |
|
prepend ( mixed $data ) |
Insert the given markup as the first child. |
|
prependTo ( DOMQuery $dest ) |
Take all nodes in the current object and prepend them to the children nodes of
each matched node in the passed-in DOMQuery object. |
|
prev ( string $selector = null ) |
Get the next sibling before each element in the DOMQuery. |
|
prevAll ( string $selector = null ) |
Get the previous siblings for each element in the DOMQuery. |
|
prevUntil ( string $selector = null ) |
Get the previous siblings for each element in the DOMQuery
until the selector is reached. |
|
remove ( string $selector = null ) |
Remove any items from the list if they match the selector. |
|
removeAttr ( string $name ) |
Remove the named attribute from all elements in the current DOMQuery. |
|
removeChildren ( ) |
Remove all child nodes. |
|
removeClass ( string $class = false ) |
Remove the named class from any element in the DOMQuery that has it. |
|
replaceAll ( string $selector, DOMDocument $document ) |
This replaces everything that matches the selector with the first value
in the current list. |
|
replaceWith ( mixed $new ) |
Replace the existing element(s) in the list with a new one. |
|
setMatches ( $matches, $unique = true ) |
EXPERT: Be very, very careful using this. |
|
siblings ( string $selector = null ) |
Get a list of siblings for elements currently wrapped by this object. |
|
size ( ) : integer |
Get the number of elements currently wrapped by this object. |
|
slice ( integer $start, integer $length ) |
Narrow the items in this object down to only a slice of the starting items. |
|
sort ( callback $comparator, boolean $modifyDOM = false ) |
Sort the contents of the QueryPath object. |
|
tag ( ) : string |
The tag name of the first element in the list. |
|
text ( string $text = null ) : mixed |
Get or set the text contents of a node. |
|
textAfter ( $text = null ) |
|
|
textBefore ( string $text = null ) : mixed |
Get or set the text before each selected item. |
|
textImplode ( string $sep = ', ', boolean $filterEmpties = true ) : string |
Retrieve the text of each match and concatenate them with the given separator. |
|
toArray ( ) : array |
Get all current elements wrapped in an array. |
|
top ( string $selector = null ) |
Select the root element of the document. |
|
unwrap ( ) |
Remove the parent element from the selected node or nodes. |
|
val ( string $value = null ) : mixed |
Set or get the value of an element's 'value' attribute. |
|
wrap ( mixed $markup ) |
Wrap each element inside of the given markup. |
|
wrapAll ( string $markup ) |
Wrap all elements inside of the given markup. |
|
wrapInner ( string $markup ) |
Wrap the child elements of each item in the list with the given markup. |
|
writeHTML ( string $path = null ) |
Writes HTML to output. |
|
writeXHTML ( string $path = null ) |
Write an XHTML file to output. |
|
writeXML ( string $path = null, integer $options = null ) |
Send the XML document to the client. |
|
xhtml ( string $markup = null ) : mixed |
Set or get XHTML markup for an element or elements. |
|
xinclude ( ) |
On an XML document, load all XIncludes. |
|
xml ( string $markup = null ) : mixed |
Set or get the XML markup for an element or elements. |
|
xpath ( string $query, array $options = [] ) |
Execute an XPath query and store the results in the QueryPath. |
|