From eeb32df46e8c385c89d74ea2303f6d68deffc9d9 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Thu, 4 Aug 2011 12:41:31 -0700 Subject: [PATCH] Added check for missing template file --- flight/View.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flight/View.php b/flight/View.php index e4dd04d..5b2ef5b 100644 --- a/flight/View.php +++ b/flight/View.php @@ -77,7 +77,13 @@ class View { extract($this->data); - include $this->path.'/'.$this->template; + $file = $this->path.'/'.$this->template; + + if (!file_exists($file)) { + throw new Exception("Template file not found: $file."); + } + + include $file; } /**