Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
create View instance after adding model params for request
  • Loading branch information
ceeram committed Feb 24, 2012
1 parent 4edb378 commit 677f070
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/Cake/Controller/Controller.php
Expand Up @@ -903,15 +903,6 @@ public function render($view = null, $layout = null) {
return $this->response;
}

$viewClass = $this->viewClass;
if ($this->viewClass != 'View') {
list($plugin, $viewClass) = pluginSplit($viewClass, true);
$viewClass = $viewClass . 'View';
App::uses($viewClass, $plugin . 'View');
}

$View = new $viewClass($this);

if (!empty($this->uses)) {
foreach ($this->uses as $model) {
list($plugin, $className) = pluginSplit($model);
Expand All @@ -922,6 +913,15 @@ public function render($view = null, $layout = null) {
$this->request->params['models'][$this->modelClass] = array('plugin' => $this->plugin, 'className' => $this->modelClass);
}

$viewClass = $this->viewClass;
if ($this->viewClass != 'View') {
list($plugin, $viewClass) = pluginSplit($viewClass, true);
$viewClass = $viewClass . 'View';
App::uses($viewClass, $plugin . 'View');
}

$View = new $viewClass($this);

$models = ClassRegistry::keys();
foreach ($models as $currentModel) {
$currentObject = ClassRegistry::getObject($currentModel);
Expand Down

0 comments on commit 677f070

Please sign in to comment.