From f0c51a01efa7cc886896fc7f6faada27dc9627a7 Mon Sep 17 00:00:00 2001 From: Awilum Date: Fri, 9 Mar 2018 20:20:20 +0300 Subject: [PATCH] Page - minor improvements --- rawilum/Page.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rawilum/Page.php b/rawilum/Page.php index ddaecc5c..5d2907c9 100755 --- a/rawilum/Page.php +++ b/rawilum/Page.php @@ -104,10 +104,16 @@ class Page */ public function renderPage($page) { - $template_ext = '.php'; + $template_ext = '.php'; $template_name = empty($page['template']) ? 'index' : $page['template']; + $site_theme = $this->rawilum['config']->get('site.theme'); + $template_path = THEMES_PATH . '/' . $site_theme . '/' . $template_name . $template_ext; - include THEMES_PATH . '/' . $this->rawilum['config']->get('site.theme') . '/' . $template_name . $template_ext; + if ($this->rawilum['filesystem']->exists($template_path)) { + include $template_path; + } else { + throw new RuntimeException("Rawilum site config file does not exist."); + } } /**