Lines Matching refs:a

12 Deprecated features generate deprecation notices (via a call to the
17 run a script along the lines of the following::
27 The ``collectDir()`` method compiles all templates found in a directory,
33 method instead. ``collect()`` takes a ``Traversable`` which must return
38 classes). To catch all notices, register a custom error handler like the one
58 a look at the `symfony/phpunit-bridge
60 process a lot.
62 Making a Layout conditional
66 and sometimes decorated with a layout. As Twig layout template names can be
67 any valid expression, you can pass a variable that evaluates to ``true`` when
81 When including a template, its name does not need to be a string. For
82 instance, the name can depend on the value of a variable:
91 As a matter of fact, the template name can be any valid expression, such as
98 Overriding a Template that also extends itself
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
108 directory *replaces* another one from a directory further in the list.
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)?
125 You can replace this template by putting a file with the same name in
137 It turns out it is possible to get this to work, by adding a directory right
142 extend a template with an overriding version of itself we can reference its
201 When Twig encounters a variable like ``article.title``, it tries to find a
272 When a function (or a filter) is not defined, Twig defaults to throw a
273 ``\Twig\Error\SyntaxError`` exception. However, it can also call a `callback`_ (any
274 valid PHP callable) which should return a function (or a filter).
289 If the callable is not able to return a valid function (or filter), it must
303 When template code is provided by a third-party (through a web interface for
305 saving it. If the template code is stored in a `$template` variable, here is
316 If you iterate over a set of files, you can pass the filename to the
372 Reusing a stateful Node Visitor
375 When attaching a visitor to a ``\Twig\Environment`` instance, Twig uses it to
377 around, you probably want to reset it when visiting a new template.
386 // reset the state as we are entering a new template
395 Using a Database to store Templates
398 If you are developing a CMS, templates are usually stored in a database. This
399 recipe gives you a simple PDO template loader you can use as a starting point
402 First, let's create a temporary in-memory SQLite3 database to work with::
415 We have created a simple ``templates`` table that hosts two templates:
418 Now, let's define a loader able to use this database::
488 contributed templates in a database, you might want to keep the original/base
493 same way as we would have done it with a regular filesystem loader. This is
495 filesystem, or any other loader for that matter: the template name should be a
511 Loading a Template from a String
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
535 Mixing different template syntaxes in the same file is not a recommended