Welcome Guest, Not a member yet? Register   Sign In
Save config items into a separate config file
#1

[eluser]CARP[/eluser]
I'm thinking about making a controller/view specific to configure application settings, like company name, address, email, phone, fax.

Is there any way (helper, library) to save this settings into a config file, which will be loaded automatically from autload.php ?

If file doesn't exists, or $config['companydata_name'] is empty, then I'd redirect automatically to the controller

Thanks a lot in advance,
#2

[eluser]pistolPete[/eluser]
Did you read the user guide?
http://ellislab.com/codeigniter/user-gui...onfig.html

Quote:... if you prefer to keep your configuration items separate (assuming you even need config items), simply create your own file and save it in config folder.

Note: If you do create your own config files use the same format as the primary one, storing your items in an array called $config. CodeIgniter will intelligently manage these files so there will be no conflict even though the array has the same name (assuming an array index is not named the same as another).

If you really want to edit the files using PHP, have a look at
- http://ellislab.com/forums/viewthread/131748/
- http://ellislab.com/forums/viewthread/130595/
#3

[eluser]CARP[/eluser]
Yes, I guess I'll have to create the file first, set some config variables, and then to load and save from controllers
Thanks pistolPete




Theme © iAndrew 2016 - Forum software by © MyBB