final class TemplateParser

Constants

LocationHead

LocationText

LocationTag

Properties

Block[][] $blocks
$blockLayer
$location
$lastIndentation

Methods

parse(string $template, TemplateLexer $lexer)

Parses tokens to nodes.

parseFragment(callable $resolver, callable $after = null)

No description

Node|null
inTextResolve()

No description

parseText()

No description

parseLatteComment()

No description

Node|null
parseLatteStatement()

No description

addTags(array $parsers)

No description

void
ensureIsConsumed(Tag $tag)

No description

void
checkBlockIsUnique(Block $block)

No description

setPolicy(Policy|null $policy)

No description

setContentType(string $type)

No description

string
getContentType()

No description

getStream()

No description

getLexer()

No description

Tag|null
peekTag()

No description

Tag
pushTag(Tag $tag)

No description

void
popTag()

No description

int
generateId()

No description

bool
isTagAllowed(string $name)

No description

Details

at line 57
TemplateNode parse(string $template, TemplateLexer $lexer)

Parses tokens to nodes.

Parameters

string $template
TemplateLexer $lexer

Return Value

TemplateNode

Exceptions

CompileException

at line 83
FragmentNode parseFragment(callable $resolver, callable $after = null)

No description

Parameters

callable $resolver
callable $after

Return Value

FragmentNode

at line 105
Node|null inTextResolve()

No description

Return Value

Node|null

at line 119
TextNode parseText()

No description

Return Value

TextNode

at line 150
NopNode parseLatteComment()

No description

Return Value

NopNode

at line 162
Node|null parseLatteStatement()

No description

Return Value

Node|null

at line 287
TemplateParser addTags(array $parsers)

No description

Parameters

array $parsers

Return Value

TemplateParser

at line 358
void ensureIsConsumed(Tag $tag)

No description

Parameters

Tag $tag

Return Value

void

at line 367
void checkBlockIsUnique(Block $block)

No description

Parameters

Block $block

Return Value

void

at line 384
TemplateParser setPolicy(Policy|null $policy)

No description

Parameters

Policy|null $policy

Return Value

TemplateParser

at line 391
TemplateParser setContentType(string $type)

No description

Parameters

string $type

Return Value

TemplateParser

at line 399
string getContentType()

No description

Return Value

string

at line 406
TokenStream getStream()

internal  
 

No description

Return Value

TokenStream

at line 412
TemplateLexer getLexer()

No description

Return Value

TemplateLexer

at line 418
Tag|null peekTag()

No description

Return Value

Tag|null

at line 424
Tag pushTag(Tag $tag)

No description

Parameters

Tag $tag

Return Value

Tag

at line 432
void popTag()

No description

Return Value

void

at line 438
int generateId()

No description

Return Value

int

at line 444
bool isTagAllowed(string $name)

No description

Parameters

string $name

Return Value

bool

Traits

Better OOP experience.