Moving output into a property, and removing extra arguments from helpers. Having a view property reduces the number of strings that are copied around.

This commit is contained in:
mark_story 2010-11-04 23:55:50 -04:00
parent 2dff74d037
commit aaff059132
2 changed files with 4 additions and 6 deletions

View file

@ -814,10 +814,9 @@ class Helper extends Object {
* Overridden in subclasses. * Overridden in subclasses.
* *
* @param string $viewFile The view file that was rendered. * @param string $viewFile The view file that was rendered.
* @param string $content The content of the rendered view.
* @return void * @return void
*/ */
public function afterRender($viewFile, $content) { public function afterRender($viewFile) {
} }
/** /**
@ -837,10 +836,9 @@ class Helper extends Object {
* Overridden in subclasses. * Overridden in subclasses.
* *
* @param string $layoutFile The layout file that was rendered. * @param string $layoutFile The layout file that was rendered.
* @param string $content The content of the rendered layout.
* @return void * @return void
*/ */
public function afterLayout($layoutFile, $content) { public function afterLayout($layoutFile) {
} }
/** /**

View file

@ -401,7 +401,7 @@ class View extends Object {
if ($action !== false && $viewFileName = $this->_getViewFileName($action)) { if ($action !== false && $viewFileName = $this->_getViewFileName($action)) {
$this->Helpers->trigger('beforeRender', array($viewFileName)); $this->Helpers->trigger('beforeRender', array($viewFileName));
$this->output = $this->_render($viewFileName); $this->output = $this->_render($viewFileName);
$this->Helpers->trigger('afterRender', array($viewFileName, $this->output)); $this->Helpers->trigger('afterRender', array($viewFileName));
} }
if ($layout === null) { if ($layout === null) {
@ -462,7 +462,7 @@ class View extends Object {
throw new RuntimeException(sprintf(__("Error in layout %s, got no content."), $layoutFileName)); throw new RuntimeException(sprintf(__("Error in layout %s, got no content."), $layoutFileName));
} }
$this->Helpers->trigger('afterLayout', array($layoutFileName, $this->output)); $this->Helpers->trigger('afterLayout', array($layoutFileName));
return $this->output; return $this->output;
} }