Lines Matching refs:to

5 will be most useful as reference to those creating Twig templates.
41 one is used to execute statements such as for-loops, the latter prints the
42 result of an expression to the template.
64 Also, `TwigFiddle`_ is an online service that allows you to execute Twig templates
70 The application passes variables to the templates for manipulation in the
75 You can use a dot (``.``) to access attributes of a variable (methods or
85 interpreted as the minus operator), use the ``attribute`` function instead to
90 {# equivalent to the non-working foo.data-foo #}
95 It's important to know that the curly braces are *not* part of the
100 when the ``strict_variables`` option is set to ``false``; alternatively, if ``strict_variables``
123 If you want to access a dynamic attribute of a variable, use the
138 You can assign values to variables inside code blocks. Assignments use the
153 applied to the next.
178 Go to the :doc:`filters<filters/index>` page to learn more about built-in
184 Functions can be called to generate content. Functions are called by their
196 Go to the :doc:`functions<functions/index>` page to learn more about the
222 {{ data|convert_encoding(from='iso-2022-jp', to='UTF-8') }}
224 Named arguments also allow you to skip some arguments for which you don't want
225 to change the default value:
229 …{# the first argument is the date format, which defaults to the global date format if null is pass…
250 A control structure refers to all those things that control the flow of a
255 For example, to display a list of users provided in a variable called
267 The :doc:`if<tags/if>` tag can be used to test an expression:
279 Go to the :doc:`tags<tags/index>` page to learn more about the built-in tags.
285 #}``. This is useful for debugging or to add information for other template
299 The :doc:`include<functions/include>` function is useful to include a template
306 By default, included templates have access to the same context as the template
316 The included template ``render_box.html`` is able to access the ``box`` variable.
319 ``\Twig\Loader\FilesystemLoader`` allows you to access other templates by giving the
332 allows you to build a base "skeleton" template that contains all the common
336 Sounds complicated but it is very basic. It's easier to understand it by
363 child templates can fill in. All the ``block`` tag does is to tell the
383 Welcome to my awesome homepage.
395 It's possible to render the contents of the parent block by using the
430 :ref:`autoescape<environment_options>` option and defaults to ``html``.
435 If manual escaping is enabled, it is **your** responsibility to escape
436 variables if needed. What to escape? Any variable you don't trust.
446 the escaping context, you might want to explicitly use any other available
460 template to be escaped or not by using the :doc:`autoescape<tags/autoescape>`
470 variables in other contexts, you need to explicitly escape them with the
482 It is sometimes desirable or even necessary to have Twig ignore parts it would
484 used and you want to use ``{{`` as raw string in the template and not start a
485 variable you have to use a trick.
487 The easiest way is to output the variable delimiter (``{{``) by using a variable
494 For bigger sections it makes sense to mark a block
504 are useful to reuse often used HTML fragments to not repeat yourself.
515 Macros can be defined in any template, and need to be "imported" via the
547 If extra positional arguments are passed to a macro call, they end up in the
555 Twig allows expressions everywhere. These work very similar to regular PHP and
574 {# use parenthesis to change precedence #}
589 example as arguments to function calls, filters or just to extend or include
610 {# keys as names (equivalent to the previous hash) -- as of Twig 1.5 #}
640 Twig allows you to calculate with values. This is rarely useful in templates
643 * ``+``: Adds two objects together (the operands are casted to numbers). ``{{
662 * ``**``: Raises the left operand to the power of the right operand. ``{{ 2 **
707 For complex string comparisons, the ``matches`` operator allows you to use
732 You can use this filter to perform a containment test on strings, arrays,
741 {# is equivalent to #}
747 The ``is`` operator performs tests. Tests can be used to test a variable against
768 {# is equivalent to #}
771 Go to the :doc:`tests<tests/index>` page to learn more about the built-in
791 {# equivalent to #}
795 due to the :ref:`operator precedence rules <twig-expressions>`:
830 String interpolation (``#{expression}``) allows any valid expression to appear
851 Use the ``spaceless`` tag to remove whitespace *between HTML tags*:
863 In addition to the spaceless tag you can also control whitespace on a per tag
878 use it to remove whitespace around tags. Trimming space will consume all whitespace
879 for that side of the tag. It is possible to use whitespace trimming on one side
897 If you want to create your own, read the :ref:`Creating an