PHP 클래스 Habari\HTMLDoc

파일 보기 프로젝트 열기: habari/system

공개 프로퍼티들

프로퍼티 타입 설명
$dom DomDocument
$xp DOMXPath

공개 메소드들

메소드 설명
__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

메소드 상세

__construct() 공개 메소드

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

__toString() 공개 메소드

Render this DOM as a string
public __toString ( ) : string
리턴 string the string representation of the DOM

create() 공개 정적인 메소드

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

find() 공개 메소드

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

find_one() 공개 메소드

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

get() 공개 메소드

Return the HTML represented by the DOM
public get ( ) : string
리턴 string The requested HTML

query() 공개 메소드

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
리턴 HTMLNodes A list of qualifying nodes

프로퍼티 상세

$dom 공개적으로 프로퍼티

public DomDocument $dom
리턴 DomDocument

$xp 공개적으로 프로퍼티

public DOMXPath $xp
리턴 DOMXPath