Hi everyone! Imagine, that i need to have save some web app settings in database,
then i face with problem that i need to use them while app initialization and cant get
them cause i dont have CI super object i.e. $this
For example, I have few langs in database - en, fr, pl with full names and when i create routing for them
i need to be sure which langs avaiable.
So how we know that DB object creates with autoload in Controller constructor method (if use database autoload) but
router class (with config route file) and Lang class injecting before Controller constructor.
1)And I'm thinking what would be the best choice? Create DB object and get db app settings by myself? where is the best place
for this?
2)And how could i make some cache to prevent requesting DB for settings while every http request? Maybe create some file after settings has changed by admin, is this good one?
At the end I need just array with langs but editable using admin panel and DB
Thanks!