config = Register::get('Config')->get('view'); return $this; } public function cache($status) { // TODO: Implement cache() method. return true; } public function fetch($file, $param, $cache) { $baseViewDir = rtrim($this->config['dir'], '/') . '/'; $loader = new FilesystemLoader($baseViewDir); $loader->addPath($baseViewDir, 'base'); $template = new Environment($loader, [ 'cache' => rtrim($this->config['cacheDir'], '/') . '/', 'auto_reload' => true, 'debug' => DEBUG ]); $templateFile = '@base/' . $file . '.' . $this->config['ext']; return $template->render($templateFile, $param); } }