More stuff for twig sample

This commit is contained in:
DanyaPostfactum 2013-06-24 18:41:57 +10:00
commit 91884280e2
2 changed files with 29 additions and 7 deletions

View file

@ -1,3 +1,4 @@
<!DOCTYPE html>
<html>
<head>

View file

@ -1,9 +1,30 @@
{% autoescape true %}
{{ var }}
{{ var|raw }} {# var won't be escaped #}
{{ var|escape }} {# var won't be doubled-escaped #}
{% endautoescape %}
<!DOCTYPE html>
<html>
<head>
<title>My Webpage</title>
</head>
<body>
<ul id="navigation">
{% for item in navigation %}
<li><a href="{{ item.href|escape }}">{{ item.caption }}</a></li>
{% endfor %}
</ul>
{{ include('twig.html', sandboxed = true) }}
{% if 1 not in [1, 2, 3] %}
{{"string #{with} \" escapes" 'another#one' }}
{# is equivalent to #}
{% if not (1 in [1, 2, 3]) %}
{% autoescape true %}
{{ var }}
{{ var|raw }} {# var won't be escaped #}
{{ var|escape }} {# var won't be doubled-escaped #}
{% endautoescape %}
{{ include('twig.html', sandboxed = true) }}
{{"string #{with} \" escapes" 'another#one' }}
<h1>My Webpage</h1>
{{ a_variable }}
</body>
</html>