Compiler
class Compiler
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_ICAL |
Context-aware escaping content types |
CONTENT_TEXT |
Context-aware escaping content types |
internal CONTEXT_HTML_TEXT |
|
internal CONTEXT_HTML_TAG |
|
internal CONTEXT_HTML_ATTRIBUTE |
|
internal CONTEXT_HTML_ATTRIBUTE_JS |
|
internal CONTEXT_HTML_ATTRIBUTE_CSS |
|
internal CONTEXT_HTML_ATTRIBUTE_URL |
|
internal CONTEXT_HTML_ATTRIBUTE_UNQUOTED_URL |
|
internal CONTEXT_HTML_COMMENT |
|
internal CONTEXT_HTML_BOGUS_COMMENT |
|
internal CONTEXT_HTML_CSS |
|
internal CONTEXT_HTML_JS |
|
internal CONTEXT_XML_TEXT |
|
internal CONTEXT_XML_TAG |
|
internal CONTEXT_XML_ATTRIBUTE |
|
internal CONTEXT_XML_COMMENT |
|
internal CONTEXT_XML_BOGUS_COMMENT |
|
Methods
Compiles tokens to PHP code.
No description
No description
Returns current line number.
No description
Adds custom method to template.
Returns custom methods.
Adds custom property to template.
Returns custom properites.
No description
Generates code for {macro ...} to the output.
Generates code for {/macro ...} to the output.
Generates code for macro
Expands macro and returns node & code.
Details
at line 100
Compiler
addMacro(string $name, IMacro $macro, int $flags = null)
Adds new macro with IMacro flags.
at line 116
string
compile(array $tokens, string $className)
Compiles tokens to PHP code.
at line 196
Compiler
setContentType(string $type)
No description
at line 204
MacroNode|null
getMacroNode()
No description
at line 213
int|null
getLine()
Returns current line number.
at line 221
bool
isInHead()
No description
at line 231
void
addMethod(string $name, string $body, string $arguments = '')
internal |
Adds custom method to template.
at line 241
array
getMethods()
internal |
Returns custom methods.
at line 251
void
addProperty(string $name, $value)
internal |
Adds custom property to template.
at line 261
array
getProperties()
internal |
Returns custom properites.
at line 268
string
expandTokens(string $s)
internal |
No description
at line 493
MacroNode
openMacro(string $name, string $args = null, string $modifiers = null, bool $isRightmost = false, string $nPrefix = null)
internal |
Generates code for {macro ...} to the output.
at line 520
MacroNode
closeMacro(string $name, string $args = null, string $modifiers = null, bool $isRightmost = false, string $nPrefix = null)
internal |
Generates code for {/macro ...} to the output.
at line 598
void
writeAttrsMacro(string $html)
internal |
Generates code for macro
at line 704
MacroNode
expandMacro(string $name, string $args, string $modifiers = null, string $nPrefix = null)
internal |
Expands macro and returns node & code.
Traits
Better OOP experience.