Example #1
0
 /**
  * @param View $view
  * @throws \Exception
  */
 private function init($view)
 {
     $this->template['engine'] = new Engine(rtrim($view->getPath(), '/'), ltrim($view->getExtension(), '.'));
     foreach ($this->extensions as $extension) {
         is_callable($extension) ? $this->template['engine']->loadExtension(call_user_func($extension)) : $this->template['engine']->loadExtension(new $extension());
     }
 }
Example #2
0
 /**
  * @param View $view
  * @return Twig_Loader_Filesystem
  */
 private function loadTemplate($view)
 {
     $this->template['response'] = 'template';
     return new Twig_Loader_Filesystem($view->getPath());
 }