Welcome Guest, Not a member yet? Register   Sign In
How to prevent variables bleeding into subsequent views?
#10

[eluser]rf_dev[/eluser]
[quote author="TWP Marketing" date="1348159115"]The first instance of the var $id is made available to all subsequent views.
If you don't want it to be available, then explicitly reset it:

Code:
$data = array(
  'id'=>'', // or 'id'=null,
);
$this->load->view('mynextview',$data);
[/quote]

On a real page load I might load a dozen different views. Several views might be called as the result of database queries. It really isn't a viable solution to go nulling every single variable that might or might not have been used in any one of those dynamically called views.

That. Is a kludge.

I really can't see how it's not a problem that CI bakes in whole new namespacing issues and expects the user to unpick them. I call bug as I can't see where this behaviour could possibly be described as expected or desirable.


Messages In This Thread
How to prevent variables bleeding into subsequent views? - by El Forum - 09-21-2012, 01:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB