code: protected function initEngine()
      {
          $loader = new Twig_Loader_Filesystem($this->viewPath);
  
          if (!empty($this->cachePath)) {
              $this->engine = new Twig_Environment($loader, array(
                  'cache' => $this->cachePath,
              ));
          } else {
              $this->engine = new Twig_Environment($loader);
          }
  
          $this->registerCustomFunctions();
      }
docs: {@inheritdoc}