mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Move viewVars assignment after callbacks.
Assigning the controller viewVars after callbacks allows the controller callbacks to assign additional viewVars, or manipulate existing ones. Fixes #2335
This commit is contained in:
parent
0670b96c24
commit
457dd73ed0
1 changed files with 2 additions and 1 deletions
|
@ -283,7 +283,7 @@ class CacheHelper extends AppHelper {
|
||||||
$controller->helpers = $this->helpers = unserialize(base64_decode(\'' . base64_encode(serialize($this->_View->helpers)) . '\'));
|
$controller->helpers = $this->helpers = unserialize(base64_decode(\'' . base64_encode(serialize($this->_View->helpers)) . '\'));
|
||||||
$controller->layout = $this->layout = \'' . $this->_View->layout. '\';
|
$controller->layout = $this->layout = \'' . $this->_View->layout. '\';
|
||||||
$controller->theme = $this->theme = \'' . $this->_View->theme . '\';
|
$controller->theme = $this->theme = \'' . $this->_View->theme . '\';
|
||||||
$controller->viewVars = $this->viewVars = unserialize(base64_decode(\'' . base64_encode(serialize($this->_View->viewVars)) . '\'));
|
$controller->viewVars = unserialize(base64_decode(\'' . base64_encode(serialize($this->_View->viewVars)) . '\'));
|
||||||
Router::setRequestInfo($controller->request);
|
Router::setRequestInfo($controller->request);
|
||||||
$this->request = $request;';
|
$this->request = $request;';
|
||||||
|
|
||||||
|
@ -294,6 +294,7 @@ class CacheHelper extends AppHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
$file .= '
|
$file .= '
|
||||||
|
$this->viewVars = $controller->viewVars;
|
||||||
$this->loadHelpers();
|
$this->loadHelpers();
|
||||||
extract($this->viewVars, EXTR_SKIP);
|
extract($this->viewVars, EXTR_SKIP);
|
||||||
?>';
|
?>';
|
||||||
|
|
Loading…
Add table
Reference in a new issue