mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Removing the trigger_error and view re-renders and replacing them with exceptions.
This commit is contained in:
parent
76919902b9
commit
882efa883e
1 changed files with 16 additions and 21 deletions
|
@ -399,8 +399,9 @@ class View extends Object {
|
|||
if ($layout === null) {
|
||||
$layout = $this->layout;
|
||||
}
|
||||
|
||||
if ($out !== false) {
|
||||
if ($out === false) {
|
||||
throw new RuntimeException(sprintf(__("Error in view %s, got no content."), $viewFileName));
|
||||
}
|
||||
if ($layout && $this->autoLayout) {
|
||||
$out = $this->renderLayout($out, $layout);
|
||||
$isCached = (
|
||||
|
@ -414,10 +415,6 @@ class View extends Object {
|
|||
}
|
||||
}
|
||||
$this->hasRendered = true;
|
||||
} else {
|
||||
$out = $this->_render($viewFileName, $this->viewVars);
|
||||
trigger_error(sprintf(__("Error in view %s, got: <blockquote>%s</blockquote>"), $viewFileName, $out), E_USER_ERROR);
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
@ -454,9 +451,7 @@ class View extends Object {
|
|||
$this->output = $this->_render($layoutFileName);
|
||||
|
||||
if ($this->output === false) {
|
||||
$this->output = $this->_render($layoutFileName, $data_for_layout);
|
||||
trigger_error(sprintf(__("Error in layout %s, got: <blockquote>%s</blockquote>"), $layoutFileName, $this->output), E_USER_ERROR);
|
||||
return false;
|
||||
throw new RuntimeException(sprintf(__("Error in layout %s, got no content."), $layoutFileName));
|
||||
}
|
||||
|
||||
$this->Helpers->trigger('afterLayout', array(&$this, $layoutFileName, $this->output));
|
||||
|
|
Loading…
Reference in a new issue