How to make multiple profiles users?

Hi all. Please tell me how to implement multiple profiles with a single table of user? For example, the trainer profile, the user profile and so on. Login information will be taken from the table user, and other data (surname, name, patronymic) will be taken depending on the user role. They have different data, so it will need different data.

How to make relationships and dependencies so that you can use in other relationships?

5a33839cce39d626457769.png5a3383a49a6c3150024084.png
June 10th 19 at 14:56
1 answer
June 10th 19 at 14:58
Solution
Good morning.
The user table and the profile table. In the second table all the necessary data. The form to display depending on user role, each role has its own shape. It turns out that the coach will fill in your details, and user is your.
You look from the point of view of the user)) I do the admin part, where the editing makes the Administrator with the administrator role. There is a list of coaches and have a list of customers. And he also edits the Administrator. Trainers one controller User s other. That's all you need to combine)) - jacquelyn_Nikolaus84 commented on June 10th 19 at 15:01
Only for User-s I have done. I can't do TrenerSearch. The rest seems to be working out - jacquelyn_Nikolaus84 commented on June 10th 19 at 15:04
Understood)) - jacquelyn_Nikolaus84 commented on June 10th 19 at 15:07
why You need two controller? One controller, two scenarios for trainers and users. Sorting on role for the administrator. - Dion77 commented on June 10th 19 at 15:10
I just found the url was different. Just do not know very well the scenario. Using them it is possible to do so? - jacquelyn_Nikolaus84 commented on June 10th 19 at 15:13
url will be the same. With the use of scripts data validation form is done.
For different URLs you can use slug, configure the urlManager. The controller one, and the addresses will be different. Or different actions to do and the form's action to conditionally substitute.
A bunch of options. - Dion77 commented on June 10th 19 at 15:16
I find it easier to make different controllers) Because there are a lot of different data. - jacquelyn_Nikolaus84 commented on June 10th 19 at 15:19
You on Skype? - Dion77 commented on June 10th 19 at 15:22
YES)) - jacquelyn_Nikolaus84 commented on June 10th 19 at 15:25

Find more questions by tags MySQL