Write to custom config? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Write to custom config? (/showthread.php?tid=23084) |
Write to custom config? - El Forum - 09-29-2009 [eluser]spmckee[/eluser] I have created a custom config file and am using CI's config class but how can I write to the new config? Basically I have a form in the admin panel that is reading the config, I need to be able to change those settings and save them. Any good tutorials or solutions others have come up with? Thanks! Write to custom config? - El Forum - 09-29-2009 [eluser]BrianDHall[/eluser] You might find it easier to store such config in a database, as altering the values of a config files is...well, 'non-trivial' (read: a pain in the ass, at best). Meanwhile changing db settings are super-easy and relatively pain-free. Write to custom config? - El Forum - 09-29-2009 [eluser]spmckee[/eluser] It's interesting you say that and I originally thought the same. I've used different CMSs in the past and I've seen them use a mix of DB and .php configs. I guess I started going down this path because CI has the config class which takes care of half the battle. If it's a real pain to write to then it looks like DB may be the way to go. Write to custom config? - El Forum - 09-29-2009 [eluser]spmckee[/eluser] Think I'm gonna stay with the text config. It's a beautiful thing when I can load the config in My_Controller and access it globally without having to mess with a query. And wouldn't you know it, 30 minutes later I come across the answer somwherez. For those interested: Code: <?php Write to custom config? - El Forum - 10-14-2009 [eluser]Mr. Ed[/eluser] I'll give it a try, buy but you are missing the allready written data in the config file. I'll fight with that. Thanks! Write to custom config? - El Forum - 10-14-2009 [eluser]pistolPete[/eluser] Have also a look at http://ellislab.com/forums/viewthread/131748/. |