mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 20:06:31 +00:00
minor #2005 [Doc] Add a note about escaping backslashes inside strings (javiereguiluz)
This PR was squashed before being merged into the 1.x branch (closes #2005).
Discussion
----------
[Doc] Add a note about escaping backslashes inside strings
Backslashes inside strings caused some confusion for some users. See https://github.com/symfony/symfony/issues/18207
Commits
-------
463ea80 [Doc] Add a note about escaping backslashes inside strings
This commit is contained in:
+3
-1
@@ -586,7 +586,9 @@ exist:
|
||||
string. They are useful whenever you need a string in the template (for
|
||||
example as arguments to function calls, filters or just to extend or include
|
||||
a template). A string can contain a delimiter if it is preceded by a
|
||||
backslash (``\``) -- like in ``'It\'s good'``.
|
||||
backslash (``\``) -- like in ``'It\'s good'``. If the string contains a
|
||||
backslash (e.g. ``'c:\Program Files'``) escape it by doubling it
|
||||
(e.g. ``'c:\\Program Files'``).
|
||||
|
||||
* ``42`` / ``42.23``: Integers and floating point numbers are created by just
|
||||
writing the number down. If a dot is present the number is a float,
|
||||
|
||||
Reference in New Issue
Block a user