class Compiler extends Object

Latte compiler.

Constants

CONTENT_HTML

Context-aware escaping content types

CONTENT_XHTML

Context-aware escaping content types

CONTENT_XML

Context-aware escaping content types

CONTENT_JS

Context-aware escaping content types

CONTENT_CSS

Context-aware escaping content types

CONTENT_URL

Context-aware escaping content types

CONTENT_ICAL

Context-aware escaping content types

CONTENT_TEXT

Context-aware escaping content types

internal CONTEXT_COMMENT

internal CONTEXT_SINGLE_QUOTED_ATTR

internal CONTEXT_DOUBLE_QUOTED_ATTR

internal CONTEXT_UNQUOTED_ATTR

Methods

__construct()

No description

addMacro($name, IMacro $macro)

Adds new macro.

string
compile(array $tokens, $className)

Compiles tokens to PHP code.

setContentType($type)

No description

string
getContentType()

No description

setContext($context, $sub = NULL)

No description

array
getContext()

No description

string
getTemplateId()

No description

MacroNode|null
getMacroNode()

No description

int
getLine()

Returns current line number.

expandTokens($s)

No description

openMacro($name, $args = NULL, $modifiers = NULL, $isRightmost = FALSE, $nPrefix = NULL)

Generates code for {macro ...} to the output.

closeMacro($name, $args = NULL, $modifiers = NULL, $isRightmost = FALSE, $nPrefix = NULL)

Generates code for {/macro ...} to the output.

void
writeAttrsMacro($code)

Generates code for macro to the output.

expandMacro($name, $args, $modifiers = NULL, $nPrefix = NULL)

Expands macro and returns node & code.

Details

at line 69
__construct()

No description

at line 80
Compiler addMacro($name, IMacro $macro)

Adds new macro.

Parameters

$name
IMacro $macro

Return Value

Compiler

at line 93
string compile(array $tokens, $className)

Compiles tokens to PHP code.

Parameters

array $tokens
$className

Return Value

string

at line 143
Compiler setContentType($type)

No description

Parameters

$type

Return Value

Compiler

at line 154
string getContentType()

No description

Return Value

string

at line 163
Compiler setContext($context, $sub = NULL)

No description

Parameters

$context
$sub

Return Value

Compiler

at line 173
array getContext()

No description

Return Value

array

[context, subcontext]

at line 182
string getTemplateId()

No description

Return Value

string

at line 191
MacroNode|null getMacroNode()

No description

Return Value

MacroNode|null

at line 201
int getLine()

Returns current line number.

Return Value

int

at line 208
expandTokens($s)

internal  
 

No description

Parameters

$s

at line 402
MacroNode openMacro($name, $args = NULL, $modifiers = NULL, $isRightmost = FALSE, $nPrefix = NULL)

internal  
 

Generates code for {macro ...} to the output.

Parameters

$name
$args
$modifiers
$isRightmost
$nPrefix

Return Value

MacroNode

at line 425
MacroNode closeMacro($name, $args = NULL, $modifiers = NULL, $isRightmost = FALSE, $nPrefix = NULL)

internal  
 

Generates code for {/macro ...} to the output.

Parameters

$name
$args
$modifiers
$isRightmost
$nPrefix

Return Value

MacroNode

at line 483
void writeAttrsMacro($code)

internal  
 

Generates code for macro to the output.

Parameters

$code

Return Value

void

at line 563
MacroNode expandMacro($name, $args, $modifiers = NULL, $nPrefix = NULL)

internal  
 

Expands macro and returns node & code.

Parameters

$name
$args
$modifiers
$nPrefix

Return Value

MacroNode