User settings mechanism for Yii
Posted
by Peterim
on Stack Overflow
See other posts from Stack Overflow
or by Peterim
Published on 2010-06-05T09:34:18Z
Indexed on
2010/06/05
9:42 UTC
Read the original article
Hit count: 270
Hi guys!
I need some help with user settings mechanism for my Yii-based application.
I've created the following db structure to store user settings:
table
user
with the following fieldsid | username | email | etc.
table
settingslist
(to store a list of all possible settings with descriptions) with the following fieldsid | code | name | description
table
settings
(to store all user settings) with the following fieldsid | userid | settingslistcode | value
Now I'm stuck with the form which allows user to change his settings. I had to deal before with the regular models (i.e. for posts, comments, etc.) where every new model had only one row in the database (Post model - id | title | body |
) with the certain amount of attributes (fields of the table). But now I need to store user settings in 10-15 rows and I don't know how to apply Yii model mechanism to work with this, so I can retrieve those settings in a single form (so user could change his preferences).
Any suggestions are greatly appreciated.
Thank you!
© Stack Overflow or respective owner