summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mohr <christian.mohr@insitu.de>2018-01-03 16:42:35 +0100
committerChristian Mohr <christian.mohr@insitu.de>2018-01-03 16:42:35 +0100
commit5d7e8c0ef3f324ead7cb97a9738dc790e0b0b196 (patch)
treefaca698d06a216fee3ddc3cf6e6eca8dc31d2e33
parent7d591a3c36cd58b430125eee214a9dba36290d00 (diff)
reproduce caching behaviour for nested view() calls
Signed-off-by: Christian Mohr <christian.mohr@insitu.de>
-rw-r--r--system/core/Loader.php18
1 files changed, 7 insertions, 11 deletions
diff --git a/system/core/Loader.php b/system/core/Loader.php
index 1e5eeecd5..3506a0ef1 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -952,18 +952,14 @@ class CI_Loader {
// merge with global cached vars (first call) or last state from nested
// call stack (subsequent nested calls)
- // if (!empty($this->_ci_vars_stack)) {
- // $_ci_vars = array_merge(end($this->_ci_vars_stack), $_ci_vars);
- // } else if (!empty($this->_ci_cached_vars)) {
- // // merge with cached vars
- // $_ci_vars = array_merge($this->_ci_cached_vars, $_ci_vars);
- // }
-
- empty($_ci_vars) OR $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, $_ci_vars);
-
+ if (!empty($this->_ci_vars_stack)) {
+ $_ci_vars = array_merge(end($this->_ci_vars_stack), $_ci_vars);
+ } else if (!empty($this->_ci_cached_vars)) {
+ $_ci_vars = array_merge($this->_ci_cached_vars, $_ci_vars);
+ }
// push current _ci_vars state to stack and extract it
- // array_push($this->_ci_vars_stack, $_ci_vars);
+ array_push($this->_ci_vars_stack, $_ci_vars);
extract($this->_ci_cached_vars);
/**
@@ -983,7 +979,7 @@ class CI_Loader {
log_message('info', 'File loaded: '.$_ci_path);
// remove current _ci_vars state from stack
- // array_pop($this->_ci_vars_stack);
+ array_pop($this->_ci_vars_stack);
// Return the file data if requested
if ($_ci_return === TRUE)