RemexHtml
Fast HTML 5 parser
|
This class provides a convenient iterative view of the token stream, implemented as a Generator. More...
Static Public Member Functions | |
static Generator | generate ( $text, $options) |
Get a Generator which iterates over all tokens in the supplied HTML. | |
Protected Member Functions | |
__construct ( $text, $options) | |
Protected Attributes | |
TokenGeneratorHandler | $handler |
Tokenizer | $tokenizer |
This class provides a convenient iterative view of the token stream, implemented as a Generator.
It is intended to be used as follows:
foreach ( TokenGenerator::generate( $html, [] ) as $token ) { ... }
Performance is slightly slower than a plain TokenHandler, probably due to the need to convert event parameters to associative arrays.
|
protected |
string | $text | |
array | $options | Options passed through to Tokenizer |
|
static |
Get a Generator which iterates over all tokens in the supplied HTML.
string | $text | The HTML |
array | $options | The Tokenizer options, see Tokenizer::__construct() |
|
protected |
|
protected |