From ac3a75fe4f0df0e7f95c20baca32f11dcdc66765 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Fri, 1 Apr 2011 01:00:07 +0000 Subject: [PATCH] Added config for view path. --- flight/View.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flight/View.php b/flight/View.php index 2a38a92..1a97103 100644 --- a/flight/View.php +++ b/flight/View.php @@ -1,16 +1,16 @@ * @license http://www.opensource.org/licenses/mit-license.php * @version 0.1 */ class View { - protected $templatePath; + public $path; - public function __construct($templatePath = null) { - $this->templatePath = $templatePath ?: './views'; + public function __construct($path = null) { + $this->path = $path ?: (Flight::get('flight.view.path') ?: './views'); } /** @@ -35,7 +35,7 @@ class View { } // Display template - include $this->templatePath.'/'.((substr($file,-4) == '.php') ? $file : $file.'.php'); + include $this->path.'/'.((substr($file,-4) == '.php') ? $file : $file.'.php'); } /**