Commit b504089d authored by Taylor Otwell's avatar Taylor Otwell

moved exception view to application views and removed system view folder.

parent 2c68317b
...@@ -44,7 +44,6 @@ $constants = array( ...@@ -44,7 +44,6 @@ $constants = array(
'SESSION_PATH' => APP_PATH.'storage/sessions/', 'SESSION_PATH' => APP_PATH.'storage/sessions/',
'STORAGE_PATH' => APP_PATH.'storage/', 'STORAGE_PATH' => APP_PATH.'storage/',
'STYLE_PATH' => PUBLIC_PATH.'css/', 'STYLE_PATH' => PUBLIC_PATH.'css/',
'SYS_VIEW_PATH' => SYS_PATH.'views/',
'VIEW_PATH' => APP_PATH.'views/', 'VIEW_PATH' => APP_PATH.'views/',
); );
......
...@@ -41,7 +41,13 @@ class View { ...@@ -41,7 +41,13 @@ class View {
{ {
$this->view = $view; $this->view = $view;
$this->data = $data; $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 @@ class View { ...@@ -106,28 +112,6 @@ class View {
return ob_get_clean(); 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. * Add a view instance to the view data.
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment