1``source``
2==========
3
4.. versionadded:: 1.15
5    The ``source`` function was added in Twig 1.15.
6
7.. versionadded:: 1.18.3
8    The ``ignore_missing`` flag was added in Twig 1.18.3.
9
10The ``source`` function returns the content of a template without rendering it:
11
12.. code-block:: jinja
13
14    {{ source('template.html') }}
15    {{ source(some_var) }}
16
17When you set the ``ignore_missing`` flag, Twig will return an empty string if
18the template does not exist:
19
20.. code-block:: jinja
21
22    {{ source('template.html', ignore_missing = true) }}
23
24The function uses the same template loaders as the ones used to include
25templates. So, if you are using the filesystem loader, the templates are looked
26for in the paths defined by it.
27
28Arguments
29---------
30
31* ``name``: The name of the template to read
32* ``ignore_missing``: Whether to ignore missing templates or not
33