* `autoescape` (new in Twig 0.9.10): If set to `true`, auto-escaping will be
enabled by default for all templates (default to `true`).
+ * `optimizations` (new in Twig 0.9.10): A flag that indicates which
+ optimizations to apply (default to `-1` -- all optimizations are enabled;
+ set it to `0` to disable).
+
>**CAUTION**
>Before Twig 0.9.3, the `cache` and `auto_reload` options did not exist. They
>were passed as a second and third arguments of the filesystem loader
* * strict_variables: Whether to ignore invalid variables in templates
* (default to false).
*
- * * autoescape: Whether to enable auto-escaping (default to true).
+ * * autoescape: Whether to enable auto-escaping (default to true);
+ *
+ * * optimizations: A flag that indicates which optimizations to apply
+ * (default to -1 which means that all optimizations are enabled;
+ * set it to 0 to disable)
*
* @param Twig_LoaderInterface $loader A Twig_LoaderInterface instance
* @param array $options An array of options
'autoescape' => true,
'cache' => false,
'auto_reload' => null,
+ 'optimizations' => -1,
), $options);
$this->debug = (bool) $options['debug'];
$this->extensions = array(
'core' => new Twig_Extension_Core(),
'escaper' => new Twig_Extension_Escaper((bool) $options['autoescape']),
- 'optimizer' => new Twig_Extension_Optimizer(),
+ 'optimizer' => new Twig_Extension_Optimizer($options['optimizations']),
);
$this->strictVariables = (bool) $options['strict_variables'];
$this->runtimeInitialized = false;