Lines Matching refs:template

34     template names as keys and template contents as values (as done by
66 and sometimes decorated with a layout. As Twig layout template names can be
81 When including a template, its name does not need to be a string. For
88 If ``var`` evaluates to ``index``, the ``index_foo.html`` template will be
91 As a matter of fact, the template name can be any valid expression, such as
101 A template can be customized in two different ways:
103 * *Inheritance*: A template *extends* a parent template and overrides some
107 template it finds in a list of configured directories; a template found in a
110 But how do you combine both: *replace* a template that also extends itself
111 (aka a template in a directory further in the list)?
114 and ``.../templates/default`` in this order. The ``page.twig`` template,
125 You can replace this template by putting a file with the same name in
126 ``.../templates/mysite``. And if you want to extend the original template, you
134 Of course, this will not work as Twig will always load the template from
138 at the end of your template directories, which is the parent of all of the
140 making every template file within our system uniquely addressable. Most of the
142 extend a template with an overriding version of itself we can reference its
143 parent's full, unambiguous template path in the extends tag:
174 Here are some configuration example that simulates some other template engines
234 instance, if you have the following template data::
243 And the following template to display all messages in all topics:
303 When template code is provided by a third-party (through a web interface for
304 instance), it might be interesting to validate the template syntax before
305 saving it. If the template code is stored in a `$template` variable, here is
309 $twig->parse($twig->tokenize(new \Twig\Source($template)));
311 // the $template is valid
313 // $template contains one or more syntax errors
321 $twig->parse($twig->tokenize(new \Twig\Source($template, $file->getFilename(), $file)));
323 // the $template is valid
325 // $template contains one or more syntax errors
336 is enforced during template rendering (as Twig needs the context for some
343 with ``apc.stat`` set to ``0`` and Twig cache enabled, clearing the template
377 around, you probably want to reset it when visiting a new template.
386 // reset the state as we are entering a new template
399 recipe gives you a simple PDO template loader you can use as a starting point
492 As you can see in the previous recipe, we reference the template in the exact
495 filesystem, or any other loader for that matter: the template name should be a
514 From a template, you can easily load a template stored in a string via the
522 From PHP, it's also possible to load a template stored in a string via
525 $template = $twig->createTemplate('hello {{ name }}');
526 echo $template->render(['name' => 'Fabien']);
535 Mixing different template syntaxes in the same file is not a recommended
539 Still, if you want to use AngularJS and Twig in the same template, there are
547 * Changing the delimiters of one of the template engines (depending on which