=========
.. versionadded:: 1.12.3
- The batch filter was added in Twig 1.12.3.
+ The ``batch`` filter was added in Twig 1.12.3.
The ``batch`` filter "batches" items by returning a list of lists with the
given number of items. If you provide a second parameter, it is used to fill
=========
.. versionadded:: 1.12.2
- The first filter was added in Twig 1.12.2.
+ The ``first`` filter was added in Twig 1.12.2.
The ``first`` filter returns the first "element" of a sequence, a mapping, or
a string:
========
.. versionadded:: 1.12.2
- The last filter was added in Twig 1.12.2.
+ The ``last`` filter was added in Twig 1.12.2.
The ``last`` filter returns the last "element" of a sequence, a mapping, or
a string:
=========
.. versionadded:: 1.5
- The nl2br filter was added in Twig 1.5.
+ The ``nl2br`` filter was added in Twig 1.5.
The ``nl2br`` filter inserts HTML line breaks before all newlines in a string:
=================
.. versionadded:: 1.5
- The number_format filter was added in Twig 1.5
+ The ``number_format`` filter was added in Twig 1.5
The ``number_format`` filter formats numbers. It is a wrapper around PHP's
`number_format`_ function:
===========
.. versionadded:: 1.6
- The slice filter was added in Twig 1.6.
+ The ``slice`` filter was added in Twig 1.6.
The ``slice`` filter extracts a slice of a sequence, a mapping, or a string:
=========
.. versionadded:: 1.10.3
- The split filter was added in Twig 1.10.3.
+ The ``split`` filter was added in Twig 1.10.3.
The ``split`` filter splits a string by the given delimiter and returns a list
of strings:
========
.. versionadded:: 1.6.2
- The trim filter was added in Twig 1.6.2.
+ The ``trim`` filter was added in Twig 1.6.2.
The ``trim`` filter strips whitespace (or other characters) from the beginning
and end of a string:
========
.. versionadded:: 1.5
- The dump function was added in Twig 1.5.
+ The ``dump`` function was added in Twig 1.5.
The ``dump`` function dumps information about a template variable. This is
mostly useful to debug a template that does not behave as expected by
===========
.. versionadded:: 1.12
- The include function was added in Twig 1.12.
+ The ``include`` function was added in Twig 1.12.
The ``include`` function returns the rendered content of a template:
==========
.. versionadded:: 1.5
- The random function was added in Twig 1.5.
+ The ``random`` function was added in Twig 1.5.
.. versionadded:: 1.6
String and integer handling was added in Twig 1.6.
==========
.. versionadded:: 1.15
- The source function was added in Twig 1.15.
+ The ``source`` function was added in Twig 1.15.
The ``source`` function returns the content of a template without rendering it:
========================
.. versionadded:: 1.11
- The template_from_string function was added in Twig 1.11.
+ The ``template_from_string`` function was added in Twig 1.11.
The ``template_from_string`` function loads a template from a string:
======
.. versionadded:: 1.5
- The do tag was added in Twig 1.5.
+ The ``do`` tag was added in Twig 1.5.
The ``do`` tag works exactly like the regular variable expression (``{{ ...
}}``) just that it doesn't print anything: