Removing the trigger_error and view re-renders and replacing them with exceptions.

This commit is contained in:
mark_story 2010-11-04 22:36:37 -04:00
parent 76919902b9
commit 882efa883e

View file

@ -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));