Welcome Guest, Not a member yet? Register   Sign In
best practice to handle global variables stored in the database
#1

Hi,

I would like to create a web application where settings are retrieved from the database. 

I would use the env file, of course,  to get the database connection settings. But only for that.
All other settings would be loaded from the the database, as said.

Why this approach? Mainly to allow clients to manage their settings their own, from the admin panel. And other few reasons...

My question is: what is the best practice to do what I would like to do?
I was thinking something like: create and entity Settings and a model, as well. Tell the controllers to use (and load) this entity.
I am not sure it is the "correct way", though.

Any help/advice would be appreciated.

Thank you very much
Reply
#2

I have found this: https://forum.codeigniter.com/thread-76758.html
Reply
#3

You might also check out this module: https://github.com/tattersoftware/codeigniter4-settings
Reply




Theme © iAndrew 2016 - Forum software by © MyBB