turned bootstrap template variants into logic

This commit is contained in:
El RIDO
2017-01-08 10:02:07 +01:00
parent 87fad1fb77
commit 67f6c4eb61
9 changed files with 25 additions and 21 deletions

View File

@@ -52,7 +52,8 @@ class View
*/
public function draw($template)
{
$path = PATH . 'tpl' . DIRECTORY_SEPARATOR . $template . '.php';
$file = substr($template, 0, 9) === 'bootstrap' ? 'bootstrap' : $template;
$path = PATH . 'tpl' . DIRECTORY_SEPARATOR . $file . '.php';
if (!file_exists($path)) {
throw new Exception('Template ' . $template . ' not found!', 80);
}