Zest.php (https://github.com/wikimedia/zest.php) Copyright (c) 2019, C.
More...
|
static array | find (string $sel, $context, array $opts=[]) |
| Find elements matching a CSS selector underneath $context.
|
|
static bool | matches ( $el, string $sel, array $opts=[]) |
| Determine whether an element matches the given selector.
|
|
static array< DOMElement > | getElementsById ( $context, string $id, array $opts=[]) |
| Get descendants by ID.
|
|
static array< DOMElement > | getElementsByTagName ( $context, string $tagName, array $opts=[]) |
| Get descendants by tag name.
|
|
Zest.php (https://github.com/wikimedia/zest.php) Copyright (c) 2019, C.
Scott Ananian. (MIT licensed) PHP port based on:
Zest (https://github.com/chjj/zest) A css selector engine. Copyright (c) 2011-2012, Christopher Jeffrey. (MIT Licensed) Domino version based on Zest v0.1.3 with bugfixes applied.
◆ find()
static array Wikimedia\Zest\Zest::find |
( |
string | $sel, |
|
|
| $context, |
|
|
array | $opts = [] ) |
|
static |
Find elements matching a CSS selector underneath $context.
- Parameters
-
string | $sel | The CSS selector string |
DOMDocument | DOMDocumentFragment | DOMElement | $context | The scoping root for the search |
array | $opts | Additional match-context options (optional) |
- Returns
- array Elements matching the CSS selector
◆ getElementsById()
static array< DOMElement > Wikimedia\Zest\Zest::getElementsById |
( |
| $context, |
|
|
string | $id, |
|
|
array | $opts = [] ) |
|
static |
Get descendants by ID.
The PHP DOM doesn't provide this method for DOMElement, and the implementation in DOMDocument is broken.
- Parameters
-
DOMDocument | DOMDocumentFragment | DOMElement | $context | The scoping root for the search |
string | $id | |
array | $opts | Additional match-context options (optional) |
- Returns
- array<DOMElement> A list of the elements with the given ID. When there are more than one, this method might return all of them or only the first one.
◆ getElementsByTagName()
static array< DOMElement > Wikimedia\Zest\Zest::getElementsByTagName |
( |
| $context, |
|
|
string | $tagName, |
|
|
array | $opts = [] ) |
|
static |
Get descendants by tag name.
The PHP DOM doesn't provide this method for DOMElement, and the implementation in DOMDocument has performance issues.
- Parameters
-
DOMDocument | DOMDocumentFragment | DOMElement | $context | |
string | $tagName | |
array | $opts | Additional match-context options (optional) |
- Returns
- array<DOMElement>
◆ matches()
static bool Wikimedia\Zest\Zest::matches |
( |
| $el, |
|
|
string | $sel, |
|
|
array | $opts = [] ) |
|
static |
Determine whether an element matches the given selector.
- Parameters
-
DOMNode | $el | The element to be tested |
string | $sel | The CSS selector string |
array | $opts | Additional match-context options (optional) |
- Returns
- bool True iff the element matches the selector
The documentation for this class was generated from the following file: