In today’s tutorial we will see how can set and get a config value in Codeigniter. Codeignter is a very flexible framework with a lot of options to build a complete website. Basically, the Config class provides a means to retrieve configuration preferences. We don’t use Config class directly in our application as we have global object is there.
To set a value in config
$this->config->set_item('title','Best Programming Blog');
To get a value from config.
$title = $this->config->item('title'); print $title;
Note: This is not for permanent change, and this will be only for a particular function or inside a class.