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:
mark_story 2011-12-03 14:45:21 -05:00
parent 0670b96c24
commit 457dd73ed0

View file

@ -283,7 +283,7 @@ class CacheHelper extends AppHelper {
$controller->helpers = $this->helpers = unserialize(base64_decode(\'' . base64_encode(serialize($this->_View->helpers)) . '\'));
$controller->layout = $this->layout = \'' . $this->_View->layout. '\';
$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);
$this->request = $request;';
@ -294,6 +294,7 @@ class CacheHelper extends AppHelper {
}
$file .= '
$this->viewVars = $controller->viewVars;
$this->loadHelpers();
extract($this->viewVars, EXTR_SKIP);
?>';