Welcome Guest, Not a member yet? Register   Sign In
View Data Issue
#11

I don't see much value in a fourth parameter because control of the cached data is already available in existing functions. Likewise, I think a new config setting adds complexity that could lead to more confusion due to unexpected behaviour than it intends to resolve.  

If you feel the need to clear the cached view data the previously mentioned clear_vars() makes this trivial

PHP Code:
$this->load
    
->view('some_view'$data)
 
   ->clear_vars(); // Clears cached view variables 

The loader class provides several other functions for manipulating cached view data.

PHP Code:
$this->load
    
->vars($vars[, $val ''])  // produces the same result as using the second parameter of the $this->load->view()
 
   ->get_var($key// retrieves the value if key is found, NULL if not
 
   ->get_vars(); // retrieves an array of all variables available to your views. 

Documentation on these functions found here.

I would be interested in knowing what "security hole" you see. I don't see it.

IMO, if there is a problem with how "view data" works it is with the documentation. An explicit explanation of the caching mechanism and what that means for subsequently loaded views might eliminate a lot of "issue" reports and developer confusion.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB