CodeIgniter Forums

Full Version: Load settings from database at bootstrap
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Saquib[/eluser]
I want to load some settings from database in my application, I am planing to do that using a model which will be auto-loaded from config.

In model construct i will perform actions like a db query and fetch settings and store it in session for later use.

Quote:Application is allowed access from current ip address
Is App is marked as offline
Setting TimeZone for app

My Question is

Quote:What is the right way to load settings which should be available at very early stage in app (on bootstrap) ?
Is it good to store settings in Session ? what else can be done (Almost 25 columns data)?

Please help !

El Forum

[eluser]Procode[/eluser]
If you dont want to store the data in a database you can always create a custom config file. It tells you exactly how in the user guide.

El Forum

[eluser]Saquib[/eluser]
[quote author="Procode" date="1347848928"]If you dont want to store the data in a database you can always create a custom config file. It tells you exactly how in the user guide.[/quote]

My Settings are saved in Database, i need to use some other way to solve it.

I am going to try below solution :-)

http://ellislab.com/forums/viewthread/223925/

El Forum

[eluser]CroNiX[/eluser]
I just extend the Controller with MY_Controller and have MY_Controller get that data from the database and stick it in an array, which anything else can then use.