Welcome Guest, Not a member yet? Register   Sign In
Connect database application/core/MY_Config

(This post was last modified: 06-28-2015, 06:44 PM by Wong.)


I need some help, I store default language in database I need to connect database in application/core/MY_Config for get some value from database for set config item and save that value to session.

Those step must to be happen before application/core/MY_Lang load.

I try coding below it's not working. What should I do ?

class MY_Config extends CI_Config {

   var $CI;

   public function __construct(){

       $this->CI  =& get_instance();



You usually don't need to override the CI_Config class to get the language information from the database in time to have it set for loading language files. In your base controller, get the language from the database before you load any language files and call
$this->config->set_item('language', $languageFromDb);

Thank you

Theme © iAndrew 2016 - Forum software by © MyBB