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: 265

Filed under:
|
|
|
|

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:

  1. table user with the following fields

    id | username | email | etc.

  2. table settingslist (to store a list of all possible settings with descriptions) with the following fields

    id | code | name | description

  3. table settings (to store all user settings) with the following fields

    id | 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

Related posts about form

Related posts about model