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
- {php expression} evaluate PHP statement
- {_expression} echo translation with escaping
- {attr ?} HTML element attributes
- {capture ?} ... {/capture} capture block to parameter
- {spaceless} ... {/spaceless} compress whitespaces
- {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
void
initialize()
Initializes before template parsing.
array|null
finalize()
Finishes template parsing.
Details
at line 46
static
install(Compiler $compiler)
No description
at line 97
void
initialize()
Initializes before template parsing.
at line 107
array|null
finalize()
Finishes template parsing.
at line 125
macroIf(MacroNode $node, PhpWriter $writer)
{if ...}
at line 143
macroEndIf(MacroNode $node, PhpWriter $writer)
{/if ...}
at line 162
macroElse(MacroNode $node, PhpWriter $writer)
{else}
at line 185
macroIfContent(MacroNode $node, PhpWriter $writer)
n:ifcontent
at line 196
macroEndIfContent(MacroNode $node, PhpWriter $writer)
n:ifcontent
at line 207
macroTranslate(MacroNode $node, PhpWriter $writer)
{_$var |modifiers}
at line 229
macroInclude(MacroNode $node, PhpWriter $writer)
{include "file" [,] [params]}
at line 252
macroUse(MacroNode $node, PhpWriter $writer)
{use class MacroSet}
at line 266
macroCapture(MacroNode $node, PhpWriter $writer)
{capture $variable}
at line 281
macroCaptureEnd(MacroNode $node, PhpWriter $writer)
{/capture}
at line 293
macroSpaceless(MacroNode $node, PhpWriter $writer)
{spaceless} ... {/spaceless}
at line 308
macroWhile(MacroNode $node, PhpWriter $writer)
{while ...}
at line 323
macroEndWhile(MacroNode $node, PhpWriter $writer)
{/while ...}
at line 338
macroEndForeach(MacroNode $node, PhpWriter $writer)
{foreach ...}
at line 368
macroBreakContinueIf(MacroNode $node, PhpWriter $writer)
{breakIf ...} {continueIf ...}
at line 384
macroClass(MacroNode $node, PhpWriter $writer)
n:class="..."
at line 396
macroAttr(MacroNode $node, PhpWriter $writer)
n:attr="..."
at line 405
macroDump(MacroNode $node, PhpWriter $writer)
{dump ...}
at line 421
macroDebugbreak(MacroNode $node, PhpWriter $writer)
{debugbreak ...}
at line 436
macroVar(MacroNode $node, PhpWriter $writer)
{var ...} {default ...}
at line 487
macroExpr(MacroNode $node, PhpWriter $writer)
{= ...} {php ...}
at line 502
macroContentType(MacroNode $node, PhpWriter $writer)
{contentType ...}
at line 539
macroStatus(MacroNode $node, PhpWriter $writer)
{status ...}