Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
wouterj merged 1 commit intosymfony:2.7fromxabbuh:default-twig-escape-strategy
Nov 10, 2016
Merged
Changes fromall 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 deletionsreference/configuration/twig.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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 DownExpand 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
contentsaccording to thefilenameextension (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 thetemplate nameextension (e.g. it uses ``html`` for ``*.html.twig``
templates and ``js`` for ``*.js.html`` templates).

.. tip::

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp