CoreMacros
class CoreMacros extends MacroSet
Basic macros for Latte.
- {if ?} ... {elseif ?} ... {else} ... {/if}
- {ifset ?} ... {elseifset ?} ... {/ifset}
- {for ?} ... {/for}
- {foreach ?} ... {/foreach}
- {$variable} with escaping
- {=expression} echo with escaping
- {?expression} evaluate PHP statement
- {_expression} echo translation with escaping
- {attr ?} HTML element attributes
- {capture ?} ... {/capture} capture block to parameter
- {var var => value} set template parameter
- {default var => value} set default template parameter
- {dump $var}
- {debugbreak}
- {contentType ...} HTTP Content-Type header
- {status ...} HTTP status
- {l} {r} to display { }
Methods
Details
at line 43
static
install(Compiler $compiler)
No description
at line 92
finalize()
Finishes template parsing.
at line 107
macroIf(MacroNode $node, PhpWriter $writer)
{if ...}
at line 122
macroEndIf(MacroNode $node, PhpWriter $writer)
{/if ...}
at line 141
macroElse(MacroNode $node, PhpWriter $writer)
{else}
at line 158
macroIfContent(MacroNode $node, PhpWriter $writer)
n:ifcontent
at line 173
macroEndIfContent(MacroNode $node, PhpWriter $writer)
n:ifcontent
at line 188
macroTranslate(MacroNode $node, PhpWriter $writer)
{_$var |modifiers}
at line 205
macroInclude(MacroNode $node, PhpWriter $writer)
{include "file" [,] [params]}
at line 221
macroUse(MacroNode $node, PhpWriter $writer)
{use class MacroSet}
at line 231
macroCapture(MacroNode $node, PhpWriter $writer)
{capture $variable}
at line 245
macroCaptureEnd(MacroNode $node, PhpWriter $writer)
{/capture}
at line 254
macroEndForeach(MacroNode $node, PhpWriter $writer)
{foreach ...}
at line 271
macroBreakContinueIf(MacroNode $node, PhpWriter $writer)
{breakIf ...} {continueIf ...}
at line 284
macroClass(MacroNode $node, PhpWriter $writer)
n:class="..."
at line 293
macroAttr(MacroNode $node, PhpWriter $writer)
n:attr="..."
at line 302
macroDump(MacroNode $node, PhpWriter $writer)
{dump ...}
at line 313
macroDebugbreak(MacroNode $node, PhpWriter $writer)
{debugbreak ...}
at line 324
macroVar(MacroNode $node, PhpWriter $writer)
{var ...} {default ...}
at line 372
macroExpr(MacroNode $node, PhpWriter $writer)
{= ...} {? ...}
at line 381
macroContentType(MacroNode $node, PhpWriter $writer)
{contentType ...}
at line 415
macroStatus(MacroNode $node, PhpWriter $writer)
{status ...}