Public Member Functions | Static Public Member Functions | Public Attributes

HTMLDoc Class Reference

List of all members.

Public Member Functions

 __construct ($html)
 find ($find)
 find_one ($find)
 query ($expression,\DomNode $contextnode=null, $registerNodeNS=true)
 get ()
 __toString ()

Static Public Member Functions

static create ($html)

Public Attributes

 $xp
 $dom

Detailed Description

Definition at line 10 of file htmldoc.php.


Constructor & Destructor Documentation

HTMLDoc::__construct ( html  ) 

Create a HTMLDoc object

Parameters:
string $html The HTML to parse

Definition at line 21 of file htmldoc.php.


Member Function Documentation

HTMLDoc::__toString (  ) 

Render this DOM as a string

Returns:
string the string representation of the DOM

Definition at line 94 of file htmldoc.php.

static HTMLDoc::create ( html  )  [static]

Fluent constructor for HTMLDoc objects

Parameters:
string $html The HTML to parse
Returns:
HTMLDoc An instance of the HTMLDoc object created

Definition at line 34 of file htmldoc.php.

HTMLDoc::find ( find  ) 

Find elements in the DOM based on CSS selector

Parameters:
string $find A CSS selector
Returns:
HTMLNodes A list of qualifying nodes

Definition at line 44 of file htmldoc.php.

HTMLDoc::find_one ( find  ) 

Find the first element in the DOM based on a CSS selector

Parameters:
string $find A CSS selector
Returns:
HTMLNode A qualifying node

Definition at line 56 of file htmldoc.php.

HTMLDoc::get (  ) 

Return the HTML represented by the DOM

Returns:
string The requested HTML

Definition at line 80 of file htmldoc.php.

HTMLDoc::query ( expression,
\DomNode $  contextnode = null,
registerNodeNS = true 
)

Pass a query on to the XPath query method

Parameters:
string $expression An XPath expression
\DomNode $contextnode The context of the query, by default, the root node
bool $registerNodeNS true by default, false to disable the automatic registration of the context node
Returns:
HTMLNodes A list of qualifying nodes

Definition at line 71 of file htmldoc.php.

Referenced by find(), find_one(), and get().


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