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

This commit is contained in:
Taylor Otwell
2011-07-31 12:54:22 -05:00
parent 2c68317b0d
commit b504089db7
3 changed files with 7 additions and 24 deletions

View File

@@ -41,7 +41,13 @@ class View {
{
$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 @@ class View {
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.
*