Refactor some if/else checks
This commit is contained in:
parent
1ace4c95b5
commit
a763bf1d8c
3 changed files with 5 additions and 29 deletions
|
@ -15,14 +15,11 @@ class HtmlEngine extends Render
|
|||
$basePath = $_SERVER['DOCUMENT_ROOT'];
|
||||
$viewsPath = app()->resourcePath('views/' . str_replace('.', '/', $this->view) . '.php');
|
||||
|
||||
if (file_exists($viewsPath)) {
|
||||
extract($this->data);
|
||||
|
||||
include $viewsPath;
|
||||
|
||||
return;
|
||||
if (!file_exists($viewsPath)) {
|
||||
throw new \Exception('View not found');
|
||||
}
|
||||
|
||||
throw new \Exception('View not found');
|
||||
extract($this->data);
|
||||
include $viewsPath;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue