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

static 
install(Compiler $compiler)

No description

finalize()

Finishes template parsing.

macroIf(MacroNode $node, PhpWriter $writer)

{if ...}

macroEndIf(MacroNode $node, PhpWriter $writer)

{/if ...}

macroElse(MacroNode $node, PhpWriter $writer)

{else}

macroIfContent(MacroNode $node, PhpWriter $writer)

n:ifcontent

macroEndIfContent(MacroNode $node, PhpWriter $writer)

n:ifcontent

macroTranslate(MacroNode $node, PhpWriter $writer)

{_$var |modifiers}

macroInclude(MacroNode $node, PhpWriter $writer)

{include "file" [,] [params]}

macroUse(MacroNode $node, PhpWriter $writer)

{use class MacroSet}

macroCapture(MacroNode $node, PhpWriter $writer)

{capture $variable}

macroCaptureEnd(MacroNode $node, PhpWriter $writer)

{/capture}

macroEndForeach(MacroNode $node, PhpWriter $writer)

{foreach ...}

macroBreakContinueIf(MacroNode $node, PhpWriter $writer)

{breakIf ...} {continueIf ...}

macroClass(MacroNode $node, PhpWriter $writer)

n:class="..."

macroAttr(MacroNode $node, PhpWriter $writer)

n:attr="..."

macroDump(MacroNode $node, PhpWriter $writer)

{dump ...}

macroDebugbreak(MacroNode $node, PhpWriter $writer)

{debugbreak ...}

macroVar(MacroNode $node, PhpWriter $writer)

{var ...} {default ...}

macroExpr(MacroNode $node, PhpWriter $writer)

{= ...} {? ...}

macroContentType(MacroNode $node, PhpWriter $writer)

{contentType ...}

macroStatus(MacroNode $node, PhpWriter $writer)

{status ...}

Details

at line 41
static install(Compiler $compiler)

No description

Parameters

Compiler $compiler

at line 91
finalize()

Finishes template parsing.

at line 106
macroIf(MacroNode $node, PhpWriter $writer)

{if ...}

Parameters

MacroNode $node
PhpWriter $writer

at line 124
macroEndIf(MacroNode $node, PhpWriter $writer)

{/if ...}

Parameters

MacroNode $node
PhpWriter $writer

at line 143
macroElse(MacroNode $node, PhpWriter $writer)

{else}

Parameters

MacroNode $node
PhpWriter $writer

at line 166
macroIfContent(MacroNode $node, PhpWriter $writer)

n:ifcontent

Parameters

MacroNode $node
PhpWriter $writer

at line 181
macroEndIfContent(MacroNode $node, PhpWriter $writer)

n:ifcontent

Parameters

MacroNode $node
PhpWriter $writer

at line 196
macroTranslate(MacroNode $node, PhpWriter $writer)

{_$var |modifiers}

Parameters

MacroNode $node
PhpWriter $writer

at line 213
macroInclude(MacroNode $node, PhpWriter $writer)

{include "file" [,] [params]}

Parameters

MacroNode $node
PhpWriter $writer

at line 229
macroUse(MacroNode $node, PhpWriter $writer)

{use class MacroSet}

Parameters

MacroNode $node
PhpWriter $writer

at line 242
macroCapture(MacroNode $node, PhpWriter $writer)

{capture $variable}

Parameters

MacroNode $node
PhpWriter $writer

at line 256
macroCaptureEnd(MacroNode $node, PhpWriter $writer)

{/capture}

Parameters

MacroNode $node
PhpWriter $writer

at line 265
macroEndForeach(MacroNode $node, PhpWriter $writer)

{foreach ...}

Parameters

MacroNode $node
PhpWriter $writer

at line 285
macroBreakContinueIf(MacroNode $node, PhpWriter $writer)

{breakIf ...} {continueIf ...}

Parameters

MacroNode $node
PhpWriter $writer

at line 301
macroClass(MacroNode $node, PhpWriter $writer)

n:class="..."

Parameters

MacroNode $node
PhpWriter $writer

at line 313
macroAttr(MacroNode $node, PhpWriter $writer)

n:attr="..."

Parameters

MacroNode $node
PhpWriter $writer

at line 322
macroDump(MacroNode $node, PhpWriter $writer)

{dump ...}

Parameters

MacroNode $node
PhpWriter $writer

at line 338
macroDebugbreak(MacroNode $node, PhpWriter $writer)

{debugbreak ...}

Parameters

MacroNode $node
PhpWriter $writer

at line 352
macroVar(MacroNode $node, PhpWriter $writer)

{var ...} {default ...}

Parameters

MacroNode $node
PhpWriter $writer

at line 403
macroExpr(MacroNode $node, PhpWriter $writer)

{= ...} {? ...}

Parameters

MacroNode $node
PhpWriter $writer

at line 412
macroContentType(MacroNode $node, PhpWriter $writer)

{contentType ...}

Parameters

MacroNode $node
PhpWriter $writer

at line 449
macroStatus(MacroNode $node, PhpWriter $writer)

{status ...}

Parameters

MacroNode $node
PhpWriter $writer