mirror of
https://github.com/twigphp/Twig.git
synced 2026-10-24 12:46:44 +00:00
Add a note about how to escape a string interpolation in a string
This commit is contained in:
@@ -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
|
||||
~~~~
|
||||
|
||||
|
||||
Reference in New Issue
Block a user