views:

65

answers:

1

Hi,

I'm trying to change the language of one webapp in realtime using codeigniter.

I follow the online documentation, create the folder for language2 with all the traductions, but when I do:

$this->config->set_item('language', 'portuguese');  

It don't change the lang, the only way it works is changing the config file ex:

$config['language'] = "english";

But what I need is change in realtime not changing the config of the framework.

Regards,
Pedro

A: 

Use hooks instead of class constructor, or even extend the Controller to MY_Controller and call in it's constructor.

Otar