Twig API
Class

Twig_Lexer

class Twig_Lexer implements Twig_LexerInterface

Lexes a template string.

Constants

STATE_DATA

STATE_BLOCK

STATE_VAR

STATE_STRING

STATE_INTERPOLATION

REGEX_NAME

REGEX_NUMBER

REGEX_STRING

REGEX_DQ_STRING_DELIM

REGEX_DQ_STRING_PART

PUNCTUATION

Methods

__construct(Twig_Environment $env, array $options = array())

Twig_TokenStream tokenize(string $code, string $filename = null)

Tokenizes a source code.

Details

at line 49
public __construct(Twig_Environment $env, array $options = array())

Parameters

Twig_Environment $env
array $options

at line 83
public Twig_TokenStream tokenize(string $code, string $filename = null)

Tokenizes a source code.

Parameters

string $code The source code
string $filename A unique identifier for the source code

Return Value

Twig_TokenStream A token stream instance