Answer the question
In order to leave comments, you need to log in
Yii2 - how to properly store user settings?
I'm doing the admin panel, so I got to the settings, but I can't figure out how and where it's better to store the settings? That is, there will be a settings form and I need to save them. Maybe there is a universal solution?
I'm thinking of creating a `settings` table in the database, where I will store serialized arrays of settings, I think this is convenient, since there will be more than one form with settings. But how to make "default settings"?
Answer the question
In order to leave comments, you need to log in
IMHO, the simplest is the settings table with key and value fields. If the setting value is an array, you can store it in json or serialize.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question