Removing conditional calling of View::_render() as a static method.

Updating doc blocks.
This commit is contained in:
mark_story 2009-08-20 01:15:08 -04:00
parent 3b95b4c95d
commit add1dede86

View file

@ -413,12 +413,8 @@ class View extends Object {
} }
if ($action !== false && $viewFileName = $this->_getViewFileName($action)) { if ($action !== false && $viewFileName = $this->_getViewFileName($action)) {
if (substr($viewFileName, -3) === 'ctp' || substr($viewFileName, -5) === 'thtml') {
$out = View::_render($viewFileName, $this->viewVars);
} else {
$out = $this->_render($viewFileName, $this->viewVars); $out = $this->_render($viewFileName, $this->viewVars);
} }
}
if ($layout === null) { if ($layout === null) {
$layout = $this->layout; $layout = $this->layout;
@ -449,10 +445,11 @@ class View extends Object {
/** /**
* Renders a layout. Returns output from _render(). Returns false on error. * Renders a layout. Returns output from _render(). Returns false on error.
* Several variables are created for use in layout. * Several variables are created for use in layout.
* title_for_layout - contains page title *
* content_for_layout - contains rendered view file * - `title_for_layout` - contains page title
* scripts_for_layout - contains scripts added to header * - `content_for_layout` - contains rendered view file
* cakeDebug - if debug is on, cake debug information is added. * - `scripts_for_layout` - contains scripts added to header
* - `cakeDebug` - if debug is on, cake debug information is added.
* *
* @param string $content_for_layout Content to render in a view, wrapped by the surrounding layout. * @param string $content_for_layout Content to render in a view, wrapped by the surrounding layout.
* @return mixed Rendered output, or false on error * @return mixed Rendered output, or false on error
@ -491,12 +488,7 @@ class View extends Object {
} }
$this->_triggerHelpers('beforeLayout'); $this->_triggerHelpers('beforeLayout');
if (substr($layoutFileName, -3) === 'ctp' || substr($layoutFileName, -5) === 'thtml') {
$this->output = View::_render($layoutFileName, $data_for_layout, $loadHelpers, true);
} else {
$this->output = $this->_render($layoutFileName, $data_for_layout, $loadHelpers); $this->output = $this->_render($layoutFileName, $data_for_layout, $loadHelpers);
}
if ($this->output === false) { if ($this->output === false) {
$this->output = $this->_render($layoutFileName, $data_for_layout); $this->output = $this->_render($layoutFileName, $data_for_layout);