final class TemplateLexer

Tokenizes Latte template source code.

Constants

StatePlain

StateLatteTag

StateLatteContent

StateLatteComment

StateHtmlText

StateHtmlTag

StateHtmlQuotedValue

StateHtmlQuotedNAttrValue

StateHtmlRawText

StateHtmlComment

StateHtmlBogus

ReTagName

HTML tag name for Latte needs (actually is [a-zA-Z][^\s/>]*)

NPrefix

special HTML attribute prefix

ReAttrName

HTML attribute name/value (\p{C} means \x00-\x1F except space)

Methods

__construct()

No description

tokenize(string $template)

No description

void
setState(string $state, mixed ...$args)

No description

void
pushState(string $state, mixed ...$args)

No description

void
popState()

No description

string
getState()

No description

setSyntax(string|null $type, string|null $endTag = null)

Changes tag delimiters.

void
popSyntax()

No description

Details

at line 55
__construct()

No description

at line 65
Generator tokenize(string $template)

No description

Parameters

string $template

Return Value

Generator

at line 274
void setState(string $state, mixed ...$args)

No description

Parameters

string $state
mixed ...$args

Return Value

void

at line 280
void pushState(string $state, mixed ...$args)

No description

Parameters

string $state
mixed ...$args

Return Value

void

at line 287
void popState()

No description

Return Value

void

at line 293
string getState()

No description

Return Value

string

at line 302
TemplateLexer setSyntax(string|null $type, string|null $endTag = null)

Changes tag delimiters.

Parameters

string|null $type
string|null $endTag

Return Value

TemplateLexer

at line 320
void popSyntax()

No description

Return Value

void