PHP Class simplehtmldom_1_5\simple_html_dom

Paperg - change $size from protected to public so we can easily access it Paperg - added ForceTagsClosed in the constructor which tells us whether we trust the html or not. Default is to NOT trust it.
Afficher le fichier Open project: sunra/php-simple-html-dom-parser

Méthodes publiques

Свойство Type Description
$_charset Note that this is referenced by a child node, and so it needs to be public for that node to see this information.
$_target_charset
$callback
$default_span_text
$lowercase
$nodes
$original_size Used to keep track of how large the text was when we started.
$root simple_html_dom_node
$size

Protected Properties

Свойство Type Description
$block_tags
$char
$cursor
$default_br_text
$doc
$noise
$optional_closing_tags B tags that are not closed cause us to return everything to the end of the document.
$parent
$pos
$self_closing_tags ..
$token_attr
$token_blank
$token_equal
$token_slash

Méthodes publiques

Méthode Description
__construct ( $str = null, $lowercase = true, $forceTagsClosed = true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN = true, $defaultBRText = DEFAULT_BR_TEXT, $defaultSpanText = DEFAULT_SPAN_TEXT )
__destruct ( )
__get ( $name )
__toString ( )
childNodes ( $idx ) camel naming conventions
clear ( ) clean up memory due to php5 circular references memory leak.
createElement ( $name, $value = null )
createTextNode ( $value )
dump ( $show_attr = true )
find ( $selector, $idx = null, $lowercase = false ) Paperg - allow us to specify that we want case insensitive testing of the value of the selector.
firstChild ( )
getElementById ( $id )
getElementByTagName ( $name )
getElementsById ( $id, $idx = null )
getElementsByTagName ( $name, $idx )
lastChild ( )
load ( $str, $lowercase = true, $stripRN = true, $defaultBRText = DEFAULT_BR_TEXT, $defaultSpanText = DEFAULT_SPAN_TEXT ) load html from string
loadFile ( )
load_file ( ) load html from file
remove_callback ( ) remove callback function
restore_noise ( $text ) restore noise to html content
save ( $filepath = '' ) save dom as string
search_noise ( $text ) Sometimes we NEED one of the noise elements.
set_callback ( $function_name ) set callback function

Méthodes protégées

Méthode Description
as_text_node ( $tag ) as a text node
copy_skip ( $chars )
copy_until ( $chars )
copy_until_char ( $char )
copy_until_char_escape ( $char )
link_nodes ( &$node, $is_child ) link node's parent
parse ( ) parse html content
parse_attr ( $node, $name, &$space ) parse attributes
parse_charset ( ) (or the content_type header from the last transfer), we will parse THAT, and if a charset is specified, we will use it over any other mechanism.
prepare ( $str, $lowercase = true, $stripRN = true, $defaultBRText = DEFAULT_BR_TEXT, $defaultSpanText = DEFAULT_SPAN_TEXT ) prepare HTML data and init everything
read_tag ( ) read tag info
remove_noise ( $pattern, $remove_tag = false ) save the noise in the $this->noise array.
skip ( $chars )

Method Details

__construct() public méthode

public __construct ( $str = null, $lowercase = true, $forceTagsClosed = true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN = true, $defaultBRText = DEFAULT_BR_TEXT, $defaultSpanText = DEFAULT_SPAN_TEXT )

__destruct() public méthode

public __destruct ( )

__get() public méthode

public __get ( $name )

__toString() public méthode

public __toString ( )

as_text_node() protected méthode

as a text node
protected as_text_node ( $tag )

childNodes() public méthode

camel naming conventions
public childNodes ( $idx )

clear() public méthode

..
public clear ( )

copy_skip() protected méthode

protected copy_skip ( $chars )

copy_until() protected méthode

protected copy_until ( $chars )

copy_until_char() protected méthode

protected copy_until_char ( $char )

copy_until_char_escape() protected méthode

protected copy_until_char_escape ( $char )

createElement() public méthode

public createElement ( $name, $value = null )

createTextNode() public méthode

public createTextNode ( $value )

dump() public méthode

public dump ( $show_attr = true )

find() public méthode

Paperg - allow us to specify that we want case insensitive testing of the value of the selector.
public find ( $selector, $idx = null, $lowercase = false )

firstChild() public méthode

public firstChild ( )

getElementById() public méthode

public getElementById ( $id )

getElementByTagName() public méthode

public getElementByTagName ( $name )

getElementsById() public méthode

public getElementsById ( $id, $idx = null )

getElementsByTagName() public méthode

public getElementsByTagName ( $name, $idx )

lastChild() public méthode

public lastChild ( )

load() public méthode

load html from string
public load ( $str, $lowercase = true, $stripRN = true, $defaultBRText = DEFAULT_BR_TEXT, $defaultSpanText = DEFAULT_SPAN_TEXT )

loadFile() public méthode

public loadFile ( )

load_file() public méthode

load html from file
public load_file ( )

parse() protected méthode

parse html content
protected parse ( )

parse_attr() protected méthode

parse attributes
protected parse_attr ( $node, $name, &$space )

parse_charset() protected méthode

(or the content_type header from the last transfer), we will parse THAT, and if a charset is specified, we will use it over any other mechanism.
protected parse_charset ( )

prepare() protected méthode

prepare HTML data and init everything
protected prepare ( $str, $lowercase = true, $stripRN = true, $defaultBRText = DEFAULT_BR_TEXT, $defaultSpanText = DEFAULT_SPAN_TEXT )

read_tag() protected méthode

read tag info
protected read_tag ( )

remove_callback() public méthode

remove callback function
public remove_callback ( )

remove_noise() protected méthode

save the noise in the $this->noise array.
protected remove_noise ( $pattern, $remove_tag = false )

restore_noise() public méthode

restore noise to html content
public restore_noise ( $text )

save() public méthode

save dom as string
public save ( $filepath = '' )

search_noise() public méthode

Sometimes we NEED one of the noise elements.
public search_noise ( $text )

set_callback() public méthode

set callback function
public set_callback ( $function_name )

skip() protected méthode

protected skip ( $chars )

Property Details

$_charset public_oe property

Note that this is referenced by a child node, and so it needs to be public for that node to see this information.
public $_charset

$_target_charset public_oe property

public $_target_charset

$block_tags protected_oe property

protected $block_tags

$callback public_oe property

public $callback

$char protected_oe property

protected $char

$cursor protected_oe property

protected $cursor

$default_br_text protected_oe property

protected $default_br_text

$default_span_text public_oe property

public $default_span_text

$doc protected_oe property

protected $doc

$lowercase public_oe property

public $lowercase

$nodes public_oe property

public $nodes

$noise protected_oe property

protected $noise

$optional_closing_tags protected_oe property

B tags that are not closed cause us to return everything to the end of the document.
protected $optional_closing_tags

$original_size public_oe property

Used to keep track of how large the text was when we started.
public $original_size

$parent protected_oe property

protected $parent

$pos protected_oe property

protected $pos

$root public_oe property

public simple_html_dom_node,simplehtmldom_1_5 $root
Résultat simple_html_dom_node

$self_closing_tags protected_oe property

..
protected $self_closing_tags

$size public_oe property

public $size

$token_attr protected_oe property

protected $token_attr

$token_blank protected_oe property

protected $token_blank

$token_equal protected_oe property

protected $token_equal

$token_slash protected_oe property

protected $token_slash