Best Practice To Store Static Text

I’m developing a website where the user will be able to enter some of his details like his phone number and / or his address.

So in order to help him in his tasks I’m using some dropdown lists which contain the list of all the countries and their associated area code for the phone number for instance.

My problem is I’m don’t know where I should ideally store this big list of countries ; should I put it in the database and then implement some kind of caching mechanism to avoid accessing the DB every time the dropdown is displayed ? Or should I store it into the application configuration ‘params’ array ?

Also note that even if today the website is only in english it’ll have multi-languages friendly.

I’ve been searching for this and found different solutions (db, separate files…etc), but I’m looking for the best practice in this situation.

Thanks in advance for your help !

May the yii, be with you :wink:

i prefer the database ; it can have a webUi to add/remove/modify( :lol: CRUD) items .if you use files it will be hard to develop a web ui to manipulate the underlying data .

I agree that it’s probably best to store this in the database. As you say, you could use caching to reduce the database load.

DB + caching + autocomplete )

Ok, thanks a lot for your quick replies, the database it is then :)