• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Views and passed variable scopes

#11
(04-15-2016, 02:13 PM)cartalot Wrote: There are thousands of codeigniter websites that depend on $data being available for implementing templates. This has never been an option that has to be set and its worked the same way in ci 1.7, ci 2, and ci 3. Please do not change this.

CI4 will be fundementally different, so now the time is okay to make the necessary changes, I think we should look ahead and not backward...
Reply

#12
(04-15-2016, 02:13 PM)cartalot Wrote: There are thousands of codeigniter websites that depend on $data being available for implementing templates. This has never been an option that has to be set and its worked the same way in ci 1.7, ci 2, and ci 3. Please do not change this.
I agree with Narf that the vars should not be cached at all -- unless there is some way to optionally cache the variables. The caching behavior in effect now is unexpected and barely documented and raises the possibility of problems for those who don't expect it.

Surely there's a fairly simple way the old behavior can be optionally cached for all views loaded? E.g., we might add some config setting that preserves this behavior in CI4 and have it turned off by default.
Reply

#13
(04-22-2016, 03:56 PM)sneakyimp Wrote:
(04-15-2016, 02:13 PM)cartalot Wrote: There are thousands of codeigniter websites that depend on $data being available for implementing templates. This has never been an option that has to be set and its worked the same way in ci 1.7, ci 2, and ci 3. Please do not change this.
I agree with Narf that the vars should not be cached at all -- unless there is some way to optionally cache the variables. The caching behavior in effect now is unexpected and barely documented and raises the possibility of problems for those who don't expect it.

Surely there's a fairly simple way the old behavior can be optionally cached for all views loaded? E.g., we might add some config setting that preserves this behavior in CI4 and have it turned off by default.

The behavior will change, we were discussing the lower level details.
Reply

#14
I would love to know how to overcome this in CI 2.x - I know I should be upgrading to 3 but too much to do atm.

The troubling part is the way it holds nested info. I use arrays rather than objects, so lets say I am passing $item['title'=> 'name', 'options' => ['one', 'two', 'three']] to the first and the second has no option, guess what, the second inherits the firsts options..
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.