| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<title>My Webpage</title> |
| 5 |
</head> |
| 6 |
<body> |
| 7 |
<ul id="navigation"> |
| 8 |
{% for item in navigation %} |
| 9 |
<li><a href="{{ item.href|escape }}">{{ item.caption }}</a></li> |
| 10 |
{% endfor %} |
| 11 |
</ul> |
| 12 |
|
| 13 |
{% if 1 not in [1, 2, 3] %} |
| 14 |
|
| 15 |
{# is equivalent to #} |
| 16 |
{% if not (1 in [1, 2, 3]) %} |
| 17 |
|
| 18 |
{% autoescape true %} |
| 19 |
{{ var }} |
| 20 |
{{ var|raw }} {# var won't be escaped #} |
| 21 |
{{ var|escape }} {# var won't be doubled-escaped #} |
| 22 |
{% endautoescape %} |
| 23 |
|
| 24 |
{{ include('twig.html', sandboxed = true) }} |
| 25 |
|
| 26 |
{{"string #{with} \" escapes" 'another#one' }} |
| 27 |
<h1>My Webpage</h1> |
| 28 |
{{ a_variable }} |
| 29 |
</body> |
| 30 |
</html> |