Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the value of a config item in the controller? - Codeigniter

I have a config file: application/config/breadcrumbs.php

Within the file I have the following configuration item:

$config['hide_number'] = TRUE;

How can I change the value of this config item through the controller.

I need to change the value of this config item one time only. How is this done???

like image 268
hairynuggets Avatar asked Dec 01 '22 22:12

hairynuggets


1 Answers

$this->config->load('breadcrumbs');
$this->config->set_item('hide_number', 'your value');

See the docs for more info:

http://codeigniter.com/user_guide/libraries/config.html

like image 79
Sarfraz Avatar answered Dec 29 '22 11:12

Sarfraz