PHP Класс Habari\HTMLTokenSet

Наследование: implements Iterator, implements ArrayAccess
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$escape

Защищенные свойства (Protected)

Свойство Тип Описание
$sliceOffsetBegin
$sliceOffsetLength
$tokens

Открытые методы

Метод Описание
__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 ( )

Защищенные методы

Метод Описание
find_slice ( integer $offset, string $name, array $attr ) : HTMLTokenSet This is a support function for HTMLTokenSet::slice(). It finds a specific slice

Описание методов

__construct() публичный Метод

public __construct ( $escape = true )

__tostring() публичный Метод

public __tostring ( )

current() публичный Метод

public current ( )

end() публичный Метод

public end ( )

find_slice() защищенный Метод

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
Результат HTMLTokenSet

get_end_offset() публичный Метод

Get the offset of the last token in this HTMLTokenSet
public get_end_offset ( ) : integer
Результат integer the offset of the last token in this HTMLTokenSet

insert() публичный Метод

Insert an HTMLTokenset before the given position
public insert ( HTMLTokenset $set, $pos ) : Nothing
$set HTMLTokenset
Результат Nothing

key() публичный Метод

public key ( )

next() публичный Метод

public next ( )

offsetExists() публичный Метод

ArrayAccess implementation
public offsetExists ( $offset )

offsetGet() публичный Метод

public offsetGet ( $offset )

offsetSet() публичный Метод

public offsetSet ( $offset, $value )

offsetUnset() публичный Метод

public offsetUnset ( $offset )

replace_slice() публичный Метод

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
Результат nothing

rewind() публичный Метод

Iterator implemetation:
public rewind ( )

slice() публичный Метод

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
Результат array An array of the HTMLTokenSets that were found

token_to_string() публичный статический Метод

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
Результат string The string representation of the token

tokenize_replace() публичный Метод

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
Результат HTMLTokenSet The new set of tokens created

trim_container() публичный Метод

Remove the first and last tokens from this HTMLTokenSet
public trim_container ( ) : nothing
Результат nothing

valid() публичный Метод

public valid ( )

Описание свойств

$escape публичное свойство

public $escape

$sliceOffsetBegin защищенное свойство

protected $sliceOffsetBegin

$sliceOffsetLength защищенное свойство

protected $sliceOffsetLength

$tokens защищенное свойство

protected $tokens