PHP 클래스 Habari\HTMLTokenSet

상속: implements Iterator, implements ArrayAccess
파일 보기 프로젝트 열기: habari/system

공개 프로퍼티들

프로퍼티 타입 설명
$escape

보호된 프로퍼티들

프로퍼티 타입 설명
$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