• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Load settings from database at bootstrap

#1
[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 !

#2
[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.

#3
[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/

#4
[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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.