* removed the debug tag (should be done in an extension)
* fixed trans tag when no vars are used in plural form
* fixed race condition when writing template cache
+ * added the special _charset variable to reference the current charset
* added the special _context variable to reference the current context
* renamed self to _self (to avoid conflict)
* fixed Twig_Template::getAttribute() for protected properties
> [twig]
> foo[bar]
-Twig always references two special variables (mostly useful for macros):
+Twig always references the following variables:
* `_self`: references the current template (was `self` before 0.9.9);
- * `_context`: references the current context.
+ * `_context`: references the current context;
+ * `_charset`: references the current charset (as of 0.9.9).
Filters
-------
$compiler->raw('$this');
} elseif ('_context' === $this->getAttribute('name')) {
$compiler->raw('$context');
+ } elseif ('_charset' === $this->getAttribute('name')) {
+ $compiler->raw('$this->getEnvironment()->getCharset()');
} elseif ($compiler->getEnvironment()->isStrictVariables()) {
$compiler->raw(sprintf('$this->getContext($context, \'%s\')', $this->getAttribute('name'), $this->getAttribute('name')));
} else {