protected function createTwig()
{
// $this->twig is singleton
if ($this->twig !== null) {
return;
}
if ($this->loader === null) {
$this->loader = new \Twig_Loader_Filesystem($this->paths);
}
$twig = new \Twig_Environment($this->loader, $this->config);
if ($this->config['debug']) {
$twig->addExtension(new \Twig_Extension_Debug());
}
$this->twig = $twig;
}