24 return \ob_get_clean();
27 public function setVar($name, $value) {
28 $this->vars[$name]=$value;
34 $this->vars=\array_merge($this->vars,
$vars);
41 if (\array_key_exists($name, $this->vars)) {
42 return $this->vars[$name];
53 public function render($viewName, $asString=
false) {
55 $fileName=ROOT . DS .
"views/" . $viewName;
56 $ext=\pathinfo($fileName, PATHINFO_EXTENSION);
58 $viewName=$viewName .
".php";
59 $fileName=ROOT . DS .
"views/" . $viewName;
60 if (\file_exists($fileName)) {
63 return $config[
"templateEngine"]->render($viewName, $data, $asString);
66 if (is_array($data)) {
75 throw new \Exception(
"Vue inexistante : " . $viewName);
includeFileAsString($filename)
render($viewName, $asString=false)
affiche la vue $viewName
static endswith($hay, $needle)