Welcome Guest, Not a member yet? Register   Sign In
Best place for loading web app settings from database
#1

Hi everyone! Simple question

What if I save some site settings in database, so where would be the best place for autoload it?

By now I ovveride CI_Loader function initialize

PHP Code:
public function initialize()
{
    
parent::initialize();
        
        
//Load site settings from DB
        
$CI =& get_instance();
        
$settings $CI->model_with_settings_from_database->some_method();
        foreach(
$settings As $key => $val)
        {
            
$CI->config->set_item($key$val);
        }
    } 

What u thinking about that?

Thanks!
Reply


Messages In This Thread
Best place for loading web app settings from database - by scion - 01-25-2016, 11:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB