Welcome Guest, Not a member yet? Register   Sign In
Loading user preferences...

I have a program with a table in the DB devoted to user preferences/settings. I need the settings and such in this table to be available across all the controllers of my program and I'm trying to figure out the best way to accomplish this.

I'm playing around with the idea of hitting the database every time a controller loads and pulling the preferences down and putting them in a class variable. But, that results in constantly hitting the DB for the same settings. I think there are too many to put in session variables. Does anyone know a better way to accomplish this? Is there some way I can cache this data?

Any help would be appreciated!!

[eluser]Phil Sturgeon[/eluser]
The database class uses cache. If you dont want to cache ALL data then you can just make two database config groups in database.php. Make one use cahce, and the other not!

Then you can make a User_pref.php library that uses this cache group.

Theme © iAndrew 2016 - Forum software by © MyBB