diff --git a/system/views/exception.php b/application/views/error/exception.php similarity index 100% rename from system/views/exception.php rename to application/views/error/exception.php diff --git a/public/index.php b/public/index.php index 1c6ed1bb..caf0a4cc 100644 --- a/public/index.php +++ b/public/index.php @@ -44,7 +44,6 @@ 'SESSION_PATH' => APP_PATH.'storage/sessions/', 'STORAGE_PATH' => APP_PATH.'storage/', 'STYLE_PATH' => PUBLIC_PATH.'css/', - 'SYS_VIEW_PATH' => SYS_PATH.'views/', 'VIEW_PATH' => APP_PATH.'views/', ); diff --git a/system/view.php b/system/view.php index b4e3e5f6..f91f7dfe 100644 --- a/system/view.php +++ b/system/view.php @@ -41,7 +41,13 @@ public function __construct($view, $data = array()) { $this->view = $view; $this->data = $data; - $this->path = $this->find(); + + if ( ! file_exists($path = VIEW_PATH.$view.EXT)) + { + throw new \Exception("View [$view] does not exist."); + } + + $this->path = $path; } /** @@ -106,28 +112,6 @@ public function get() return ob_get_clean(); } - /** - * Get the full path to the view. - * - * Views are cascaded, so the application directory views will take - * precedence over system directory views of the same name. - * - * @return string - */ - protected function find() - { - if (file_exists($path = VIEW_PATH.$this->view.EXT)) - { - return $path; - } - elseif (file_exists($path = SYS_VIEW_PATH.$this->view.EXT)) - { - return $path; - } - - throw new \Exception("View [".$this->view."] doesn't exist."); - } - /** * Add a view instance to the view data. *