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

Public Member Functions

 __get ($name)
 __set ($name, $value)
 location ($href=NULL)
 baseURI ($href=NULL)
 get/set baseURI
 __construct ($html, $idx=true)
 __toString ()
 url2abs ($url)
 strlen ()
 substr ($start, $length=NULL)
 _info ()
 This method is for debugging only.
 hasClass ($id, $cl)
- 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 ()

Static Public Member Functions

static get_url_base ($url, $array=false)
static get_url_path ($url)
static is_url_path ($path)
static is_abs_path ($path)
static abs_url ($url, $base)
static detect_charset ($str)
- 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)

Static Public Attributes

static $del_spaces = false
static $case_folding = true
static $autoclose_tags = false
static $_emptyTags = array('base','meta','link','hr','br','basefont','param','img','area','input','isindex','col')
static $_specialTags = array('--'=>'--', '[CDATA['=>']]')
static $_unparsedTags = array('style', 'script')
static $_index_attribs = array('href', 'src')
static $_url_attribs = array('href'=>'href', 'src'=>'src')
- 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

 _index_comments_html ($o)
 Index comment tags position in source HTML.
 _index_all ()
 _get_ctx ($ctx)
 _find ($name, $class=NULL, $attr=NULL, $ctx=NULL, $rec=true)
 _filter ($ids, $name=NULL, $class=NULL, $attr=NULL, $ctx=NULL)
 get_aids_byAttr ($attr, $as_keys=false, $actx=NULL)
 get_aids_byClass ($cl, $as_keys=false, $actx=NULL)
 get_aids_byClassAttr ($cl, $attr, $as_keys=false, $actx=NULL)
 get_ids_byAid ($aid, $sort=true, $has_keys=false)
 get_ids_byAttr ($attr, $sort=true)
 get_ids_byClass ($cl, $sort=true)
 get_ids_byClassAttr ($cl, $attr, $sort=true)
 get_attr_byAid ($aid, $to_str=false)
 get_attr_byId ($id, $attr=NULL, $to_str=false)
- 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)

Protected Attributes

 $html = ''
 $o = NULL
 $indexed = false
- Protected Attributes inherited from duzun\hQuery\Node
 $_prop = array()

Static Protected Attributes

static $_tagID_first_letter = 'a-zA-Z_'
static $_tagID_letters = 'a-zA-Z_0-9:\-'
static $_icharset = 'UTF-8'

Additional Inherited Members

- Public Attributes inherited from duzun\hQuery\Node
const VERSION = '2.0.2'
- Static Protected Member Functions inherited from duzun\hQuery\Node
static html_findTagClose ($str, $p)

Detailed Description

HTML Parser Class

Definition at line 12 of file HTML_Parser.php.

Member Function Documentation

◆ abs_url()

static duzun\hQuery\HTML_Parser::abs_url (   $url,

Given a $url (relative or absolute) and a $base url, returns absolute url for $url.

string$url- relative or absolute URL
string$base- Base URL for $url
string absolute URL for $url

Definition at line 228 of file HTML_Parser.php.

◆ get_aids_byAttr()

duzun\hQuery\HTML_Parser::get_aids_byAttr (   $attr,
  $as_keys = false,
  $actx = NULL 

Definition at line 732 of file HTML_Parser.php.

◆ get_aids_byClass()

duzun\hQuery\HTML_Parser::get_aids_byClass (   $cl,
  $as_keys = false,
  $actx = NULL 
$as_keys ? [aid => id | [ids]] : [aids]

Definition at line 756 of file HTML_Parser.php.

◆ get_ids_byAid()

duzun\hQuery\HTML_Parser::get_ids_byAid (   $aid,
  $sort = true,
  $has_keys = false 

$has_keys == true => $aid == [aid=>[ids]] $has_keys == false => $aid == [aids]

Definition at line 797 of file HTML_Parser.php.

◆ hasClass()

duzun\hQuery\HTML_Parser::hasClass (   $id,

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

int | array | string | Node$id- The context to check
string | array$cl- class(es) to check
false - no class, 0 - doesn't have any class, true - has class, [id => true]

Definition at line 660 of file HTML_Parser.php.

References duzun\hQuery\find().

◆ is_abs_path()

static duzun\hQuery\HTML_Parser::is_abs_path (   $path)

Check whether $path is an absolute path.

string$path- a path to check
bool TRUE if $path is an absolute path, FALSE otherwise

Definition at line 208 of file HTML_Parser.php.

◆ is_url_path()

static duzun\hQuery\HTML_Parser::is_url_path (   $path)

Check whether $path is a valid url.

string$path- a path to check
bool TRUE if $path is a valid URL, FALSE otherwise

Definition at line 197 of file HTML_Parser.php.

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