Welcome Guest, Not a member yet? Register   Sign In
set_item for custom configs
#1

[eluser]Unknown[/eluser]
Is there a way to set the value of a custom config. I can retrieve a custom config but I can't find a way to set it.

Code:
echo $this->config->item('base_url') . '<br>';
echo $this->config->item('base_url', 'myconfig') . '<br>';

$this->config->load('myconfig', TRUE);
echo $this->config->item('base_url') . '<br>';
echo $this->config->item('base_url', 'myconfig') . '<br>';

// This sets the base config
$this->config->set_item('base_url', 'new_url');
// How do I set the myconfig setting???
$this->config->set_item('base_url', 'new_myconfig_url', "myconfig");

echo $this->config->item('base_url') . '<br>';
echo $this->config->item('base_url', 'myconfig') . '<br>';
#2

[eluser]maesk[/eluser]
A workaround could be to not call the config item base_url but something else and not use TRUE when you load your custom config, then you could set it by its new name. To call it base_url can create confusion anyways. But it's strange that this (setting an item in custom config) is not in the User Guide. The set_item() function seems to take only two arguments, name and value.




Theme © iAndrew 2016 - Forum software by © MyBB