PHP Class Habari\HTMLDoc

Afficher le fichier Open project: habari/system

Méthodes publiques

Свойство Type Description
$dom DomDocument
$xp DOMXPath

Méthodes publiques

Méthode Description
__construct ( string $html ) Create a HTMLDoc object
__toString ( ) : string Render this DOM as a string
create ( string $html ) : HTMLDoc Fluent constructor for HTMLDoc objects
find ( string $find ) : HTMLNodes Find elements in the DOM based on CSS selector
find_one ( string $find ) : HTMLNode Find the first element in the DOM based on a CSS selector
get ( ) : string Return the HTML represented by the DOM
query ( string $expression, DomNode $contextnode = null, boolean $registerNodeNS = true ) : HTMLNodes Pass a query on to the XPath query method

Method Details

__construct() public méthode

Create a HTMLDoc object
public __construct ( string $html )
$html string The HTML to parse

__toString() public méthode

Render this DOM as a string
public __toString ( ) : string
Résultat string the string representation of the DOM

create() public static méthode

Fluent constructor for HTMLDoc objects
public static create ( string $html ) : HTMLDoc
$html string The HTML to parse
Résultat HTMLDoc An instance of the HTMLDoc object created

find() public méthode

Find elements in the DOM based on CSS selector
public find ( string $find ) : HTMLNodes
$find string A CSS selector
Résultat HTMLNodes A list of qualifying nodes

find_one() public méthode

Find the first element in the DOM based on a CSS selector
public find_one ( string $find ) : HTMLNode
$find string A CSS selector
Résultat HTMLNode A qualifying node

get() public méthode

Return the HTML represented by the DOM
public get ( ) : string
Résultat string The requested HTML

query() public méthode

Pass a query on to the XPath query method
public query ( string $expression, DomNode $contextnode = null, boolean $registerNodeNS = true ) : HTMLNodes
$expression string An XPath expression
$contextnode DomNode The context of the query, by default, the root node
$registerNodeNS boolean true by default, false to disable the automatic registration of the context node
Résultat HTMLNodes A list of qualifying nodes

Property Details

$dom public_oe property

public DomDocument $dom
Résultat DomDocument

$xp public_oe property

public DOMXPath $xp
Résultat DOMXPath