Skip to content

Commit

Permalink
Moving Component::beforeRender triggering to allow components to modify
Browse files Browse the repository at this point in the history
the view class to use for the render() call.  Fixes #917

Signed-off-by: mark_story <mark@mark-story.com>
  • Loading branch information
ceeram authored and markstory committed Jul 16, 2010
1 parent 0e184c6 commit 32ea6d2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cake/libs/controller/controller.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@ function validateErrors() {
*/ */
function render($action = null, $layout = null, $file = null) { function render($action = null, $layout = null, $file = null) {
$this->beforeRender(); $this->beforeRender();
$this->Component->triggerCallback('beforeRender', $this);


$viewClass = $this->view; $viewClass = $this->view;
if ($this->view != 'View') { if ($this->view != 'View') {
Expand All @@ -873,8 +874,6 @@ function render($action = null, $layout = null, $file = null) {
App::import('View', $this->view); App::import('View', $this->view);
} }


$this->Component->triggerCallback('beforeRender', $this);

$this->params['models'] = $this->modelNames; $this->params['models'] = $this->modelNames;


if (Configure::read() > 2) { if (Configure::read() > 2) {
Expand Down

0 comments on commit 32ea6d2

Please sign in to comment.