Twig testing is possible with TwigFiddle, where the result of any Twig code can be checked.
Note: There are some unique tags, parameters and filters, for which you cannot use this testing method easily.
Here are the exceptions for which you can’t use TwigFiddle:
-
foreach: If you wish to test code with theforeachtag, we suggest that you replace it with a simplefortag, so that you can check your code.
For example, this is how you can test the for tag instead of foreach in TwigFiddle.
{% for value in [1, 2, 3, 4] %}
{{ value }}
{% endfor %}
-
limitparameter: It’s not possible to test it in TwigFiddle -
.rds-related codes: It’s not possible to test them in TwigFiddle - It is not possible to test the following unique filters in TwigFiddle:
localized_datelocalized_timelocalized_datetimerequired
For editing your script, Atom and Notepad++ can be useful with a Twig-specific add-on.