Moving Component::beforeRender triggering to allow components to modify

the view class to use for the render() call.  Fixes 

Signed-off-by: mark_story <mark@mark-story.com>
This commit is contained in:
Ceeram 2010-07-15 14:59:29 +02:00 committed by mark_story
parent 0e184c66f4
commit 32ea6d24cf

View file

@ -865,6 +865,7 @@ class Controller extends Object {
*/ */
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') {
@ -873,8 +874,6 @@ class Controller extends Object {
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) {