/** * @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()); } }
/** * @param View $view * @return Twig_Loader_Filesystem */ private function loadTemplate($view) { $this->template['response'] = 'template'; return new Twig_Loader_Filesystem($view->getPath()); }