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 |
|
Properties
string[] | $placeholders | ||
string|null | $paramsExtraction |
Methods
Registers run-time functions.
Compiles tokens to PHP file
No description
No description
No description
No description
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.
Adds custom constant to template.
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 112
Compiler
addMacro(string $name, Macro $macro, int|null $flags = null)
Adds new macro with Macro flags.
at line 134
Compiler
setFunctions(array $names)
Registers run-time functions.
at line 145
string
compile(array $tokens, string $className, string|null $comment = null, bool $strictMode = false)
Compiles tokens to PHP file
at line 256
Compiler
setPolicy(Policy|null $policy)
No description
at line 263
Policy|null
getPolicy()
No description
at line 270
Compiler
setContentType(string $type)
No description
at line 278
string
getContentType()
No description
at line 284
MacroNode|null
getMacroNode()
No description
at line 293
array
getMacros()
No description
at line 302
array
getFunctions()
No description
at line 311
int|null
getLine()
Returns current line number.
at line 319
bool
isInHead()
No description
at line 329
void
addMethod(string $name, string $body, string $arguments = '', string $returns = '', string|null $comment = null)
internal |
Adds custom method to template.
at line 346
array
getMethods()
internal |
Returns custom methods.
at line 357
void
addProperty(string $name, mixed $value)
internal |
Adds custom property to template.
at line 368
array
getProperties()
internal |
Returns custom properites.
at line 379
void
addConstant(string $name, mixed $value)
internal |
Adds custom constant to template.
at line 386
string
expandTokens(string $s)
internal |
No description
at line 620
MacroNode
openMacro(string $name, string $args = '', string $modifiers = '', bool $isRightmost = false, string|null $nPrefix = null)
internal |
Generates code for {macro ...} to the output.
at line 648
MacroNode
closeMacro(string $name, string $args = '', string $modifiers = '', bool $isRightmost = false, string|null $nPrefix = null)
internal |
Generates code for {/macro ...} to the output.
at line 729
void
writeAttrsMacro(string $html)
internal |
Generates code for macro
at line 840
MacroNode
expandMacro(string $name, string $args, string $modifiers = '', string|null $nPrefix = null)
internal |
Expands macro and returns node & code.
Traits
Better OOP experience.