mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
create View instance after adding model params for request
This commit is contained in:
parent
4edb378ef8
commit
677f0708dc
1 changed files with 9 additions and 9 deletions
|
@ -903,15 +903,6 @@ class Controller extends Object implements CakeEventListener {
|
|||
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);
|
||||
|
@ -922,6 +913,15 @@ class Controller extends Object implements CakeEventListener {
|
|||
$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);
|
||||
|
|
Loading…
Add table
Reference in a new issue