Constructor.
Available options:
Twig_LoaderInterface $loader A Twig_LoaderInterface instance:
array $options An array of options:
public function __construct(Twig_LoaderInterface $loader = null, $options = array()) {
if (null !== $loader) {
$this
->setLoader($loader);
}
$options = array_merge(array(
'debug' => false,
'charset' => 'UTF-8',
'base_template_class' => 'Twig_Template',
'strict_variables' => false,
'autoescape' => 'html',
'cache' => false,
'auto_reload' => null,
'optimizations' => -1,
), $options);
$this->debug = (bool) $options['debug'];
$this->charset = $options['charset'];
$this->baseTemplateClass = $options['base_template_class'];
$this->autoReload = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload'];
$this->strictVariables = (bool) $options['strict_variables'];
$this->runtimeInitialized = false;
$this
->setCache($options['cache']);
$this->functionCallbacks = array();
$this->filterCallbacks = array();
$this
->addExtension(new Twig_Extension_Core());
$this
->addExtension(new Twig_Extension_Escaper($options['autoescape']));
$this
->addExtension(new Twig_Extension_Optimizer($options['optimizations']));
$this->extensionInitialized = false;
$this->staging = new Twig_Extension_Staging();
}