Welcome Guest, Not a member yet? Register   Sign In
Gathering database settings globally
#2

[eluser]CroNiX[/eluser]
I create a library that gets autoloaded, and in its construct I would have it set all of that site specific stuff set up. If they select a theme, how are you tracking that? Session? Cookie? Profile in database? Just have your get_theme() method grab the value and get it however you need to and then return the correct theme, or default if none specified.

Then you would just set something like
Code:
$theme = $this->global_library->get_theme();
This is how most AUTH libraries work too. You autoload the library and it automatically checks to see if the user is logged in. If they are it lets them proceed, if not it redirects them to the login page, and then in all of your controller constructs you just have to do something like
Code:
$this->auth_library->check_login();
instead of the actual query in every controller.


Messages In This Thread
Gathering database settings globally - by El Forum - 09-30-2010, 07:03 PM
Gathering database settings globally - by El Forum - 09-30-2010, 08:16 PM
Gathering database settings globally - by El Forum - 09-30-2010, 08:34 PM
Gathering database settings globally - by El Forum - 09-30-2010, 09:54 PM
Gathering database settings globally - by El Forum - 09-30-2010, 10:18 PM
Gathering database settings globally - by El Forum - 10-01-2010, 12:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB