Add a note about how to escape a string interpolation in a string

This commit is contained in:
Fabien Potencier
2024-08-10 11:32:28 +02:00
parent 0d524d3ae7
commit 38e47a3e94
+10
View File
@@ -589,6 +589,16 @@ inserted into the string:
{{ "foo #{bar} baz" }}
{{ "foo #{1 + 2} baz" }}
.. tip::
String interpolations can be ignored by escaping them with a backslash
(``\``):
.. code-block:: twig
{# outputs foo #{1 + 2} baz #}
{{ "foo \#{1 + 2} baz" }}
Math
~~~~