S
S
Sergey Semenko2015-01-27 17:19:36
Yii
Sergey Semenko, 2015-01-27 17:19:36

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

2 answer(s)
I
iliyaisd, 2015-01-27
@abler98

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.

M
Mikhail Osher, 2015-01-27
@miraage

For example, rdbms.
// upd
Default is db seed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question