Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[TwigBundle] update the default Twig escape strategy #7089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions reference/configuration/twig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ TwigBundle Configuration ("twig")

<twig:config
auto-reload="%kernel.debug%"
autoescape="filename"
autoescape="name"
base-template-class="Twig_Template"
cache="%kernel.cache_dir%/twig"
charset="%kernel.charset%"
Expand Down Expand Up @@ -93,7 +93,7 @@ TwigBundle Configuration ("twig")
'pi' => 3.14,
),
'auto_reload' => '%kernel.debug%',
'autoescape' => 'filename',
'autoescape' => 'name',
'base_template_class' => 'Twig_Template',
'cache' => '%kernel.cache_dir%/twig',
'charset' => '%kernel.charset%',
Expand Down Expand Up @@ -127,7 +127,7 @@ compiled again automatically.
autoescape
~~~~~~~~~~

**type**: ``boolean`` or ``string`` **default**: ``'filename'``
**type**: ``boolean`` or ``string`` **default**: ``'name'``

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

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

.. tip::

Expand Down