hQuery.php
Public Member Functions | Protected Attributes | List of all members
duzun\hQuery\Element Class Reference
Inheritance diagram for duzun\hQuery\Element:
duzun\hQuery\Node

Public Member Functions

 toArray ($cch=true)
 
 __get ($name)
 
 offsetSet ($offset, $value)
 
 offsetGet ($offset)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 current ()
 
 val ()
 
 hasClass ($className)
 
 get ($idx)
 
 eq ($idx)
 
 slice ($idx, $len=NULL)
 
 parent ()
 
 children ()
 
 previousElementSibling ()
 
 nextElementSibling ()
 
- Public Member Functions inherited from duzun\hQuery\Node
 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 ()
 

Protected Attributes

 $_ich = NULL
 
- Protected Attributes inherited from duzun\hQuery\Node
 $_prop = array()
 
 $doc
 
 $ids
 
 $exc
 

Additional Inherited Members

- Static Public Member Functions inherited from duzun\hQuery\Node
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 inherited from duzun\hQuery\Node
const VERSION = '2.0.2'
 
 $tag_map
 
- Static Public Attributes inherited from duzun\hQuery\Node
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 inherited from duzun\hQuery\Node
 __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 inherited from duzun\hQuery\Node
static html_findTagClose ($str, $p)
 

Detailed Description

Represents an HTML Element ( eg div, input etc ) or a collection of elements ( eq jQuery([div, span, ...]) )

Definition at line 12 of file Element.php.

Member Function Documentation

◆ children()

duzun\hQuery\Element::children ( )

Get child nodes for this collection of nodes.

Returns
hQuery_Element children

Definition at line 254 of file Element.php.

◆ current()

duzun\hQuery\Element::current ( )

Override current() for iterations.

Returns
hQuery_Element

Definition at line 124 of file Element.php.

◆ eq()

duzun\hQuery\Element::eq (   $idx)

Get the node at $idx position in the set, no cache, each call creates new instance.

Parameters
int$idx- index of an element, starts with 0.
Returns
hQuery_Element

Definition at line 200 of file Element.php.

◆ get()

duzun\hQuery\Element::get (   $idx)

Get the node at $idx position in the set, using cache

Parameters
int$idx- index of an element, starts with 0.
Returns
hQuery_Element

Definition at line 176 of file Element.php.

◆ hasClass()

duzun\hQuery\Element::hasClass (   $className)

Checks whether $this element/collection has a(ll) class(es).

Parameters
string | array$cl- class(es) to check
Returns
true - has class, false - no class, 0 - doesn't have any class,

Definition at line 161 of file Element.php.

References duzun\hQuery\Node\doc().

◆ nextElementSibling()

duzun\hQuery\Element::nextElementSibling ( )

Get next element siblings for each of the elements of this collection

Returns
hQuery_Element nextElementSibling

Definition at line 274 of file Element.php.

◆ parent()

duzun\hQuery\Element::parent ( )

Get parent nodes for this collection of nodes.

Returns
hQuery_Element parent

Definition at line 244 of file Element.php.

◆ previousElementSibling()

duzun\hQuery\Element::previousElementSibling ( )

Get previous element siblings for each of the elements of this collection

Returns
hQuery_Element previousElementSibling

Definition at line 264 of file Element.php.

◆ slice()

duzun\hQuery\Element::slice (   $idx,
  $len = NULL 
)

Get a slice of current node collection.

Parameters
int$idx- start index of an element, starts with 0.
int$len- OPTIONAL number of element to slice. Defaults to all starting at $idx
Returns
hQuery_Element

Definition at line 216 of file Element.php.

◆ val()

duzun\hQuery\Element::val ( )

Get value of an :input element.

Returns
mixed value of the first element in the collection.

Definition at line 138 of file Element.php.


The documentation for this class was generated from the following file: