Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ab7b82c

Browse filesBrowse files
committed
feature #7089 [TwigBundle] update the default Twig escape strategy (xabbuh)
This PR was merged into the 2.7 branch. Discussion ---------- [TwigBundle] update the default Twig escape strategy reflect the changes made in symfony/symfony#20224 Commits ------- 402d556 update the default Twig escape strategy
2 parents 5f004c3 + 402d556 commit ab7b82c
Copy full SHA for ab7b82c

File tree

Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed

‎reference/configuration/twig.rst

Copy file name to clipboardExpand all lines: reference/configuration/twig.rst
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ TwigBundle Configuration ("twig")
6262
6363
<twig:config
6464
auto-reload="%kernel.debug%"
65-
autoescape="filename"
65+
autoescape="name"
6666
base-template-class="Twig_Template"
6767
cache="%kernel.cache_dir%/twig"
6868
charset="%kernel.charset%"
@@ -93,7 +93,7 @@ TwigBundle Configuration ("twig")
9393
'pi' => 3.14,
9494
),
9595
'auto_reload' => '%kernel.debug%',
96-
'autoescape' => 'filename',
96+
'autoescape' => 'name',
9797
'base_template_class' => 'Twig_Template',
9898
'cache' => '%kernel.cache_dir%/twig',
9999
'charset' => '%kernel.charset%',
@@ -127,7 +127,7 @@ compiled again automatically.
127127
autoescape
128128
~~~~~~~~~~
129129

130-
**type**: ``boolean`` or ``string`` **default**: ``'filename'``
130+
**type**: ``boolean`` or ``string`` **default**: ``'name'``
131131

132132
If set to ``false``, automatic escaping is disabled (you can still escape each content
133133
individually in the templates).
@@ -141,9 +141,9 @@ individually in the templates).
141141

142142
If set to a string, the template contents are escaped using the strategy with
143143
that name. Allowed values are ``html``, ``js``, ``css``, ``url``, ``html_attr``
144-
and ``filename``. The default value is ``filename``. This strategy escapes
145-
contents according to the filename extension (e.g. it uses ``html`` for
146-
``*.html.twig`` templates and ``js`` for ``*.js.html`` templates).
144+
and ``name``. The default value is ``name``. This strategy escapes contents
145+
according to the template name extension (e.g. it uses ``html`` for ``*.html.twig``
146+
templates and ``js`` for ``*.js.html`` templates).
147147

148148
.. tip::
149149

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.