Merge branch '1.x'

* 1.x:
  fixed docs
  fixed typo
  fixed typo
This commit is contained in:
Fabien Potencier
2016-10-17 15:42:41 -07:00
3 changed files with 14 additions and 14 deletions
+8 -8
View File
@@ -107,14 +107,14 @@ The following options are available:
* ``autoescape`` *string*
Sets the default auto-escaping strategy (``filename``,
``html``, ``js``, ``css``, ``url``, ``html_attr``, or a PHP callback that
takes the template "filename" and returns the escaping strategy to use -- the
callback cannot be a function name to avoid collision with built-in escaping
strategies); set it to ``false`` to disable auto-escaping. The ``filename``
escaping strategy determines the escaping strategy to use for a template
based on the template filename extension (this strategy does not incur any
overhead at runtime as auto-escaping is done at compilation time.)
Sets the default auto-escaping strategy (``name``, ``html``, ``js``, ``css``,
``url``, ``html_attr``, or a PHP callback that takes the template "filename"
and returns the escaping strategy to use -- the callback cannot be a function
name to avoid collision with built-in escaping strategies); set it to
``false`` to disable auto-escaping. The ``name`` escaping strategy determines
the escaping strategy to use for a template based on the template filename
extension (this strategy does not incur any overhead at runtime as
auto-escaping is done at compilation time.)
* ``optimizations`` *integer*
+4 -4
View File
@@ -167,9 +167,9 @@ The ``embed`` tag takes the exact same arguments as the ``include`` tag:
.. warning::
As embedded templates do not have "names", auto-escaping strategies based
on the template "filename" won't work as expected if you change the
context (for instance, if you embed a CSS/JavaScript template into an HTML
one). In that case, explicitly set the default auto-escaping strategy with
the ``autoescape`` tag.
on the template name won't work as expected if you change the context (for
instance, if you embed a CSS/JavaScript template into an HTML one). In that
case, explicitly set the default auto-escaping strategy with the
``autoescape`` tag.
.. seealso:: :doc:`include<../tags/include>`
+2 -2
View File
@@ -28,9 +28,9 @@ class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase
$this->assertEquals('foo\x3Cbr\x2F\x20\x3E foo\x3Cbr\x2F\x20\x3E', $twig->render('js', array('bar' => 'foo<br/ >')));
}
public function escapingStrategyCallback($filename)
public function escapingStrategyCallback($name)
{
return $filename;
return $name;
}
public function testGlobals()