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'); } /**