Require View at end of view files...!

main
Robert 1 month ago
parent 05aefcfdfc
commit 3fbb9bc3c8
  1. 6
      src/Framework/View.php

@ -104,7 +104,7 @@ final class View
}
$fileExt = ViewType::getFileExtensionFor($type);
$file = $this->findViewPath($viewFile . $fileExt);
$file = $this->findViewPath($viewFile . "View" . $fileExt);
if ($type == ViewType::TWIG) {
$this->useTemplateEngineTwig = true;
$this->templateType = str_replace('.', '', $fileExt);
@ -122,8 +122,8 @@ final class View
}
if ($file === false) {
echo "No view file exists for: {$viewFile}!";
throw new \Exception("View File does not exist: " . $viewFile);
echo "No view file exists for: {$viewFile}View!";
throw new \Exception("View File does not exist: " . $viewFile. "View");
} else {
$this->files[] = array('file' => $file, 'path' => UseDir::PROJECT, 'fileType' => $fileExt);
}

Loading…
Cancel
Save