blob: 563baba363a86285edaecdfc8ae2353154a19f97 [file] [log] [blame]
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +01001``inky_to_html``
2================
3
4The ``inky_to_html`` filter processes an `inky email template
5<https://github.com/zurb/inky>`_:
6
7.. code-block:: html+twig
8
9 {% apply inky_to_html %}
10 <row>
11 <columns large="6"></columns>
12 <columns large="6"></columns>
13 </row>
14 {% endapply %}
15
16You can also use the filter on an included file:
17
18.. code-block:: twig
19
20 {{ include('some_template.inky.twig')|inky_to_html }}
21
22.. note::
23
24 The ``inky_to_html`` filter is part of the ``InkyExtension`` which is not
25 installed by default. Install it first:
26
27 .. code-block:: bash
28
29 $ composer require twig/inky-extra
30
31 Then, on Symfony projects, install the ``twig/extra-bundle``:
32
33 .. code-block:: bash
34
35 $ composer require twig/extra-bundle
36
37 Otherwise, add the extension explicitly on the Twig environment::
38
39 use Twig\Extra\Inky\InkyExtension;
40
41 $twig = new \Twig\Environment(...);
42 $twig->addExtension(new InkyExtension());