| 1 | <h2>Comments</h2> |
| 2 | <pre><code>/* Multi-line |
| 3 | comment */ |
| 4 | // This is a comment with <p>some markup</p> in it</code></pre> |
| 5 | |
| 6 | <h2>Variable</h2> |
| 7 | <pre><code>{$name} |
| 8 | {$folders[0]['name']} |
| 9 | {$aaa?.bbb.ccc?[0]}</code></pre> |
| 10 | |
| 11 | <h2>Commands</h2> |
| 12 | <pre><code>{template .helloNames} |
| 13 | // Greet the person. |
| 14 | {call .helloName data="all" /}<br> |
| 15 | // Greet the additional people. |
| 16 | {foreach $additionalName in $additionalNames} |
| 17 | {call .helloName} |
| 18 | {param name: $additionalName /} |
| 19 | {/call} |
| 20 | {if not isLast($additionalName)} |
| 21 | <br> // break after every line except the last |
| 22 | {/if} |
| 23 | {ifempty} |
| 24 | No additional people to greet. |
| 25 | {/foreach} |
| 26 | {/template}</code></pre> |
| 27 | |
| 28 | <h2>Functions and print directives</h2> |
| 29 | <pre><code>{if length($items) > 5} |
| 30 | {$foo|changeNewlineToBr} |
| 31 | {$bar|truncate: 4, false}</code></pre> |
| 32 | |
| 33 | <h2>Literal section</h2> |
| 34 | <pre><code>{literal} |
| 35 | This is not a {$variable} |
| 36 | {/literal}</code></pre> |