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 41
static
install(Compiler $compiler)
No description
at line 91
finalize()
Finishes template parsing.
at line 106
macroIf(MacroNode $node, PhpWriter $writer)
{if ...}
at line 124
macroEndIf(MacroNode $node, PhpWriter $writer)
{/if ...}
at line 143
macroElse(MacroNode $node, PhpWriter $writer)
{else}
at line 166
macroIfContent(MacroNode $node, PhpWriter $writer)
n:ifcontent
at line 181
macroEndIfContent(MacroNode $node, PhpWriter $writer)
n:ifcontent
at line 196
macroTranslate(MacroNode $node, PhpWriter $writer)
{_$var |modifiers}
at line 213
macroInclude(MacroNode $node, PhpWriter $writer)
{include "file" [,] [params]}
at line 229
macroUse(MacroNode $node, PhpWriter $writer)
{use class MacroSet}
at line 242
macroCapture(MacroNode $node, PhpWriter $writer)
{capture $variable}
at line 256
macroCaptureEnd(MacroNode $node, PhpWriter $writer)
{/capture}
at line 265
macroEndForeach(MacroNode $node, PhpWriter $writer)
{foreach ...}
at line 285
macroBreakContinueIf(MacroNode $node, PhpWriter $writer)
{breakIf ...} {continueIf ...}
at line 301
macroClass(MacroNode $node, PhpWriter $writer)
n:class="..."
at line 313
macroAttr(MacroNode $node, PhpWriter $writer)
n:attr="..."
at line 322
macroDump(MacroNode $node, PhpWriter $writer)
{dump ...}
at line 338
macroDebugbreak(MacroNode $node, PhpWriter $writer)
{debugbreak ...}
at line 352
macroVar(MacroNode $node, PhpWriter $writer)
{var ...} {default ...}
at line 403
macroExpr(MacroNode $node, PhpWriter $writer)
{= ...} {? ...}
at line 412
macroContentType(MacroNode $node, PhpWriter $writer)
{contentType ...}
at line 449
macroStatus(MacroNode $node, PhpWriter $writer)
{status ...}