PHP Class Habari\HTMLTokenSet

Inheritance: implements Iterator, implements ArrayAccess
Afficher le fichier Open project: habari/system

Méthodes publiques

Свойство Type Description
$escape

Protected Properties

Свойство Type Description
$sliceOffsetBegin
$sliceOffsetLength
$tokens

Méthodes publiques

Méthode Description
__construct ( $escape = true )
__tostring ( )
current ( )
end ( )
get_end_offset ( ) : integer Get the offset of the last token in this HTMLTokenSet
insert ( HTMLTokenset $set, $pos ) : Nothing Insert an HTMLTokenset before the given position
key ( )
next ( )
offsetExists ( $offset ) ArrayAccess implementation
offsetGet ( $offset )
offsetSet ( $offset, $value )
offsetUnset ( $offset )
replace_slice ( HTMLTokenSet $slice ) : nothing Replace a set of tokens in this HTMLTokenSet
rewind ( ) Iterator implemetation:
slice ( mixed $names, array $attr = null ) : array Fetch a section of the tokens, based on passed criteria
token_to_string ( array $token, boolean $escape = true ) : string Convert a token to a string
tokenize_replace ( string $source ) : HTMLTokenSet Replace a full set of tokens with new tokens. The tokens are replaced in place as well as being returned
trim_container ( ) : nothing Remove the first and last tokens from this HTMLTokenSet
valid ( )

Méthodes protégées

Méthode Description
find_slice ( integer $offset, string $name, array $attr ) : HTMLTokenSet This is a support function for HTMLTokenSet::slice(). It finds a specific slice

Method Details

__construct() public méthode

public __construct ( $escape = true )

__tostring() public méthode

public __tostring ( )

current() public méthode

public current ( )

end() public méthode

public end ( )

find_slice() protected méthode

This is a support function for HTMLTokenSet::slice(). It finds a specific slice
protected find_slice ( integer $offset, string $name, array $attr ) : HTMLTokenSet
$offset integer The offset at which to start looking for relevant tokens
$name string The name of the html tag being searched for
$attr array The attributes of the html tag being searched for
Résultat HTMLTokenSet

get_end_offset() public méthode

Get the offset of the last token in this HTMLTokenSet
public get_end_offset ( ) : integer
Résultat integer the offset of the last token in this HTMLTokenSet

insert() public méthode

Insert an HTMLTokenset before the given position
public insert ( HTMLTokenset $set, $pos ) : Nothing
$set HTMLTokenset
Résultat Nothing

key() public méthode

public key ( )

next() public méthode

public next ( )

offsetExists() public méthode

ArrayAccess implementation
public offsetExists ( $offset )

offsetGet() public méthode

public offsetGet ( $offset )

offsetSet() public méthode

public offsetSet ( $offset, $value )

offsetUnset() public méthode

public offsetUnset ( $offset )

replace_slice() public méthode

Replace a set of tokens in this HTMLTokenSet
public replace_slice ( HTMLTokenSet $slice ) : nothing
$slice HTMLTokenSet The tokens to insert in place of the old tokens
Résultat nothing

rewind() public méthode

Iterator implemetation:
public rewind ( )

slice() public méthode

Fetch a section of the tokens, based on passed criteria
public slice ( mixed $names, array $attr = null ) : array
$names mixed The name of an html tag, or an array of names of html tags to get the tokens of
$attr array Any attributes for the token that you want to filter by
Résultat array An array of the HTMLTokenSets that were found

token_to_string() public static méthode

Convert a token to a string
public static token_to_string ( array $token, boolean $escape = true ) : string
$token array The token to convert
$escape boolean Whether to escape the string that is returned
Résultat string The string representation of the token

tokenize_replace() public méthode

Replace a full set of tokens with new tokens. The tokens are replaced in place as well as being returned
public tokenize_replace ( string $source ) : HTMLTokenSet
$source string The text to create the new set of tokens from
Résultat HTMLTokenSet The new set of tokens created

trim_container() public méthode

Remove the first and last tokens from this HTMLTokenSet
public trim_container ( ) : nothing
Résultat nothing

valid() public méthode

public valid ( )

Property Details

$escape public_oe property

public $escape

$sliceOffsetBegin protected_oe property

protected $sliceOffsetBegin

$sliceOffsetLength protected_oe property

protected $sliceOffsetLength

$tokens protected_oe property

protected $tokens