More stuff for twig sample
This commit is contained in:
parent
d2f7247e58
commit
91884280e2
2 changed files with 29 additions and 7 deletions
|
|
@ -1,3 +1,4 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue