Welcome Guest, Not a member yet? Register   Sign In
Looking for Solution of CI config
#1

[eluser]vps4[/eluser]
usually, we put config setting in the database
but CI's config file loaded earlier than database library
now , the problem is : config must get through database library

my Solution is :
write a Model
but I think it's not good.

for example: some code in my Model

Code:
$query = $this->db->get('setting');

and add it to CI config

Code:
$this->config->set_item('setting', $this->setting);

and in the Controller

Code:
$something = $this->config->item('something', 'setting')

I almost collapsed, It make the simple things complicated
Although I have written to solve this problem

Is anybody have a good idea?
#2

[eluser]evanwalsh[/eluser]
I'm not exactly sure what you're trying to do here. Are you trying to use CI config values in the database config file?

If so, I have done something like that with YAML and the spyc library.




Theme © iAndrew 2016 - Forum software by © MyBB