Reputation: 13
I am new to php and trying to add parameter to config variable. In my example, I am defining success/error messages in config file. I am able to access the config variable using:
$this->config->item('msg')
But I would like to add parameter in the message and pass it using:
$this->config->item
How can I do that?
Any help greatly appreciated.
Upvotes: 0
Views: 667
Reputation: 1483
https://ellislab.com/codeigniter/user-guide/libraries/config.html
$this->config->set_item('item_name', 'item_value');
For example
$this->config->set_item('msg', 'Your Value goes here');
You can print this like this way
echo $this->config->item('msg');
Upvotes: 1
Reputation: 23
$this->config->item()
works fine.
For example if there's $config['foo'] = 'bar';
in the config using $this->config->item('foo')
will be 'bar'
Upvotes: 1