model view controller - How to query configurations from database in a custom MVC? -


i'm working on multi-language website owner requires configurations/options - must set first - stored in database, e.g.:

  • default language
  • default action
  • default theme
  • etc...

i'm confused query config (as i'm still in logic behind mvc approach).

  1. query setting directly config file? (is ok query database non-model file/class?)
  2. create class file related every set of configurations in /core directory e.g.: language.php, theme.php , query database in these files?
  3. use only models query these configurations?
  4. if using models, should access them directly config file or should use controller access them? (if understand correctly, controller medium between views , models?).
  5. other suggestions ...?

the app root contains following:

  • backend
    • core
    • lib
    • models
    • config
    • views
    • controllers
    • helpers
    • handlers
  • frontend
    • img
    • css
    • js

i ended doing through model , controller, little bit tricky though. once done, owner pleased more convenient him toggle defaults desired admincp without having edit files that.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -