file = $file . $action . ".php"; } public function generate($data) { $content = $this->generateFile($this->file, $data); $title = ""; $headScript = ""; if(isset($data['title'])) $title = $data['title']; if(isset($data['headScript'])) $headScript = $data['headScript']; $root = Configuration::get("root", "/"); $vue = $this->generateFile($GLOBALS['app_path'].'View/template.php', array('headScript'=> $headScript, 'title' => $title, 'content' => $content, 'root' => $root)); echo $vue; } private function generateFile($file, $data) { if (file_exists($file)) { extract($data); ob_start(); require $file; return ob_get_clean(); } else { throw new Exception("Fichier '$file' introuvable"); return null; } } private function clean($value) { return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false); } }