User Tools

Site Tools


en:design:twig:design-manual

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:design:twig:design-manual [30.07.2015 20:36] – this page has moved mrbasemanen:design:twig:design-manual [30.07.2015 20:39] (current) – revert previous edit - I am sorry, I was confused mrbaseman
Line 1: Line 1:
-this page has moved here: [[en:design:twig:design-manual|TWIG for Template-Designers(en)]]+====== TWIG for Template-Designers ======
  
 +This document describes the syntax and semantics of the template engine and is very useful as a reference for creating Twig templates. 
 +
 +===== Overview =====
 +
 +A template is simply a text file. It can generate any text-based format (HTML, XML, CSV, LaTeX, etc.). It doesn't have a specific extension, .html or .xml are just fine.
 +
 +A template contains variables or expressions, which get replaced with values when the template is evaluated, and tags, which control the logic of the template.
 +
 +Below is a minimal template that illustrates a few basics. We will cover further details later on:
 +
 +<code html5><!DOCTYPE html>
 +<html>
 +    <head>
 +        <title>My Webpage</title>
 +    </head>
 +    <body>
 +        <ul id="navigation">
 +        {% for item in navigation %}
 +            <li><a href="{{ item.href }}">{{ item.caption }}</a></li>
 +        {% endfor %}
 +        </ul>
 +
 +        <h1>My Webpage</h1>
 +        {{ a_variable }}
 +    </body>
 +</html></code>
en/design/twig/design-manual.1438288590.txt.gz · Last modified: 30.07.2015 20:36 by mrbaseman