Lines Matching refs:template

4 The ``extends`` tag can be used to extend a template from another one.
12 Let's define a base template, ``base.html``, which defines a simple HTML
38 All the ``block`` tag does is to tell the template engine that a child
39 template may override those portions of the template.
44 A child template might look like this:
64 The ``extends`` tag is the key here. It tells the template engine that this
65 template "extends" another template. When the template system evaluates this
66 template, first it locates the parent. The extends tag should be the first tag
67 in the template.
69 Note that since the child template doesn't define the ``footer`` block, the
70 value from the parent template is used instead.
73 template. This limitation exists because a block tag works in "both"
76 similarly-named ``block`` tags in a template, that template's parent wouldn't
150 Twig supports dynamic inheritance by using a variable as the base template:
157 instance, Twig will use it as the parent template::
167 $twig->display('template.twig', ['layout' => $layout]);
173 first template that exists will be used as a parent:
182 As the template name for the parent can be any valid Twig expression, it's
189 In this example, the template will extend the "minimum.html" layout template
196 A block provides a way to change how a certain part of a template is rendered
213 If you render this template, the result would be exactly the same with or
215 to make it overridable by a child template:
230 Now, when rendering the child template, the loop is going to use the block
231 defined in the child template instead of the one defined in the base one; the
232 executed template is then equivalent to the following one:
255 Contrary to what you might think, this template does not define a block
256 conditionally; it just makes overridable by a child template the output of