nenad-zivkovic / yii2-advanced-template

Yii2 improved advanced application template that can bake you cookies
BSD 3-Clause "New" or "Revised" License
93 stars 66 forks source link

Need to add profile fields #26

Closed gursel58 closed 8 years ago

gursel58 commented 8 years ago

I would like to add additional fields or a new table for user profile information, not sure which is the best yet. I have searched many examples of how to do it but they all seem to be based on specific versions of yii2-user and rbac What version of user/rbac is being used in yii2-advanced-template ? How would you suggest additional profile fields be added ?

Thanks

nenad-zivkovic commented 8 years ago

User/rbac is custom crafted, and based on what framework is providing. Third party modules/packages are not used.

When I want to create user profiles ( Name, address, stuff like that ), I create new table called user_profile that is related with user. Then you create controller/model/views for that. If you want to connect user profile data with articles, then you create linking table like article_profile. You craft it by you needs. So I wouldn't add profile fields to user table, but create table just for that, its kinda better design.