private function getTwigEnvironment()
{
if (null === $this->twig) {
$twigTemplate = isset($this->config['twig-template']) ? $this->config['twig-template'] : null;
$templateDir = $twigTemplate ? pathinfo($twigTemplate, PATHINFO_DIRNAME) : __DIR__ . '/../../views';
$loader = new \Twig_Loader_Filesystem($templateDir);
$this->twig = new \Twig_Environment($loader);
}
return $this->twig;
}