Lines Matching refs:template

4 This document describes the syntax and semantics of the template engine and
10 A template is simply a text file. It can generate any text-based format (HTML,
14 A template contains **variables** or **expressions**, which get replaced with
15 values when the template is evaluated, and **tags**, which control the logic
16 of the template.
18 Below is a minimal template that illustrates a few basics. We will cover further
42 result of an expression to the template.
71 template. Variables may have attributes or elements you can access,
131 * ``_self``: references the current template;
284 To comment-out part of a line in a template, use the comment syntax ``{# ...
285 #}``. This is useful for debugging or to add information for other template
290 {# note: disabled template because we no longer use this
299 The :doc:`include<functions/include>` function is useful to include a template
300 and return the rendered content of that template into the current one:
306 By default, included templates have access to the same context as the template
307 which includes them. This means that any variable defined in the main template
308 will be available in the included template too:
316 The included template ``render_box.html`` is able to access the ``box`` variable.
318 The name of the template depends on the template loader. For instance, the
331 The most powerful part of Twig is template inheritance. Template inheritance
332 allows you to build a base "skeleton" template that contains all the common
339 Let's define a base template, ``base.html``, which defines a simple HTML
364 template engine that a child template may override those portions of the
365 template.
367 A child template might look like this:
387 The :doc:`extends<tags/extends>` tag is the key here. It tells the template
388 engine that this template "extends" another template. When the template system
389 evaluates this template, first it locates the parent. The extends tag should
390 be the first tag in the template.
392 Note that since the child template doesn't define the ``footer`` block, the
393 value from the parent template is used instead.
460 template to be escaped or not by using the :doc:`autoescape<tags/autoescape>`
484 used and you want to use ``{{`` as raw string in the template and not start a
515 Macros can be defined in any template, and need to be "imported" via the
524 Alternatively, you can import individual macro names from a template into the
588 string. They are useful whenever you need a string in the template (for
590 a template). A string can contain a delimiter if it is preceded by a
847 The first newline after a template tag is removed automatically (like in PHP.)
848 Whitespace is not further modified by the template engine, so each whitespace
905 .. _`Twig language definition`: https://github.com/gabrielcorpse/gedit-twig-template-language