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).
- query setting directly config file? (is ok query database non-model file/class?)
- create class file related every set of configurations in /core directory e.g.: language.php, theme.php , query database in these files?
- use only models query these configurations?
- if using models, should access them directly config file or should use controller access them? (if understand correctly, controller medium between views , models?).
- 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
Post a Comment