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 $ext=\pathinfo($viewName, PATHINFO_EXTENSION);
57 $viewName=$viewName .
".php";
60 return $config[
"templateEngine"]->render($viewName, $data, $asString);
63 if (is_array($data)) {
66 $fileName=ROOT . DS .
"views/" . $viewName;
67 if(file_exists($fileName)){
74 throw new \Exception(
"View {$viewName} not found!");
80 return $config[
"templateEngine"]->getBlockNames($templateName);
85 return $config[
"templateEngine"]->getCode($templateName);
includeFileAsString($filename)
render($viewName, $asString=false)
affiche la vue $viewName
getBlockNames($templateName)
static endswith($hay, $needle)