hQuery.php
|
Public Member Functions | |
attr ($attr=NULL, $to_str=false) | |
is_empty () | |
isEmpty () | |
isDoc () | |
doc () | |
find ($sel, $attr=NULL) | |
exclude ($sel, $attr=NULL) | |
__toString () | |
html ($id=NULL) | |
outerHtml ($id=NULL) | |
text ($id=NULL) | |
nodeName ($caseFolding=NULL, $id=NULL) | |
pos ($restore=true) | |
_children ($ids=NULL, $n=NULL) | |
_next ($ids=NULL, $n=0) | |
_prev ($ids=NULL, $n=0) | |
_all ($ids=NULL) | |
_has ($el, $eq=false) | |
$el < $this, with $eq == true -> $el <= $this | |
_filter_contains ($el, $eq=false) | |
__get ($name) | |
__set ($name, $value) | |
__isset ($name) | |
__unset ($name) | |
count () | |
current () | |
valid () | |
key () | |
next () | |
prev () | |
rewind () | |
Static Public Member Functions | |
static | html_normal_pseudoClass ($p) |
static | html_selector2struc ($sel) |
static | html_parseAttrStr ($str, $case_folding=true, $extended=false) |
static | html_attr2str ($attr, $quote='"') |
static | parseCSStr ($str, $case_folding=true) |
static | CSSArr2Str ($css) |
static | str_range ($comp, $pos=0, $len=NULL) |
static | array_select ($arr, $keys, $force_null=false) |
static | convert_encoding ($a, $to, $from=NULL) |
Public Attributes | |
const | VERSION = '2.0.2' |
$tag_map | |
Static Public Attributes | |
static | $last_http_result |
static | $selected_doc = NULL |
static | $_ar_ = array() |
static | $_mi_ = PHP_INT_MAX |
static | $_nl_ = NULL |
static | $_fl_ = false |
static | $_tr_ = true |
Protected Member Functions | |
__construct ($doc, $ids, $is_ctx=false) | |
_ctx_ids ($ids=NULL) | |
_sub_ids ($eq=false) | |
_doc_ids ($el, $force_array=true) | |
_my_ids ($id=NULL, $keys=false) | |
_parent ($ids=NULL, $n=0) | |
Static Protected Member Functions | |
static | html_findTagClose ($str, $p) |
Protected Attributes | |
$_prop = array() | |
$doc | |
$ids | |
$exc | |
Base class for HTML Elements and Documents.
API Documentation at https://duzun.github.io/hQuery.php
MIT
|
protected |
Make a context array of ids: if x in $ids && exists y in $ids such that x in y then del x from $ids
Definition at line 256 of file Node.php.
Referenced by duzun\hQuery\Node\_has(), and duzun\hQuery\Context\intersect().
|
protected |
Get and Normalize ids of $el
Definition at line 299 of file Node.php.
References duzun\hQuery\Node\doc().
Referenced by duzun\hQuery\Node\_filter_contains(), duzun\hQuery\Node\_has(), and duzun\hQuery\Context\intersect().
duzun\hQuery\Node::_filter_contains | ( | $el, | |
$eq = false |
|||
) |
Filter all ids of $el that are contained in(side) $this->ids
hQuery_Node | array | $el | A node or list of ids |
boolean | $eq | if false, filter strict contents, otherwise $el might be in $this->ids |
Definition at line 591 of file Node.php.
References duzun\hQuery\Node\_doc_ids().
|
protected |
Get all ids from inside of this element
Definition at line 275 of file Node.php.
References duzun\hQuery\Node\doc().
duzun\hQuery\Node::attr | ( | $attr = NULL , |
|
$to_str = false |
|||
) |
Get and attribute or all attributes of first element in the collection.
string | $attr | attribute name, or NULL to get all |
boolean | $to_str | When $attr is NULL, if true, get the list of attributes as string |
Definition at line 62 of file Node.php.
References duzun\hQuery\Node\doc().
duzun\hQuery\Node::doc | ( | ) |
Get parent doc of this node.
Definition at line 88 of file Node.php.
Referenced by duzun\hQuery\Node\_doc_ids(), duzun\hQuery\Node\_sub_ids(), duzun\hQuery\Node\attr(), duzun\hQuery\Node\find(), duzun\hQuery\Element\hasClass(), duzun\hQuery\Node\nodeName(), and duzun\hQuery\Node\outerHtml().
duzun\hQuery\Node::find | ( | $sel, | |
$attr = NULL |
|||
) |
Finds a collection of nodes inside current document/context (similar to jQuery.fn.find()).
string | $sel | - A valid CSS selector (some pseudo-selectors supported). |
array | string | $attr | - OPTIONAL attributes as string or key-value pairs. |
hQuery_Node | $ctx | - OPTIONAL the context where to search. If omitted, $this is used. |
Definition at line 101 of file Node.php.
References duzun\hQuery\Node\doc().
duzun\hQuery\Node::html | ( | $id = NULL | ) |
Definition at line 142 of file Node.php.
Referenced by duzun\hQuery\Node\text().
|
static |
|
static |
Parse a selector string into an array structure.
tn1::id1 .cl1.cl2:first tn2:5 , tn3.cl3 tn4::id2:eq(-1) > tn5:last-child > tn6:lt(3) –> [ [ [{ n: "tn1", i: "id1", c: [], p: [] }], [{ n: NULL, i: NULL, c: ["cl1","cl2"], p: [0] }], [{ n: "tn2", i: NULL, c: [], p: [5] }] ] , [ [{ n: "tn3", i: NULL, c: ["cl3"], p: [] }], [ { n: "tn4", i: "id2", c: [], p: [-1] }, { n: "tn5", i: NULL , c: [], p: [-1] }, { n: "tn6", i: NULL , c: [], p: ["<3"] } ] ] ]
duzun\hQuery\Node::nodeName | ( | $caseFolding = NULL , |
|
$id = NULL |
|||
) |
Definition at line 194 of file Node.php.
References duzun\hQuery\Node\doc().
duzun\hQuery\Node::outerHtml | ( | $id = NULL | ) |
Definition at line 165 of file Node.php.
References duzun\hQuery\Node\doc().
duzun\hQuery\Node::pos | ( | $restore = true | ) |
duzun\hQuery\Node::text | ( | $id = NULL | ) |
Definition at line 187 of file Node.php.
References duzun\hQuery\Node\html().