Yii2 How to make multiple profiles?

Good evening everyone! Expect to make multiple profiles and one table user. In profiles the majority (70-80%) of the fields are identical: last name, first name, patronymic and so on ... the number of sections planned: 2-4 pieces. Additional fields to each profile yet: 4-7 pieces. Tell me your opinion on how to do development:

  1. To do everything in different controllers and different tables
  2. Make one table with all fields and one controller
  3. The table pfofile to write the overlapping data, and other data to a separate table. Further, in the controller depending on the role loadable necessary models and views using the if condition{... }esle{...}
  4. To make a different table but in the same controller. Further, in the controller depending on the role loadable necessary models and views using the if condition{... }esle{...}
June 10th 19 at 14:40
2 answers
June 10th 19 at 14:42
One of the solutions: https://habrahabr.ru/post/274925/
June 10th 19 at 14:44
You have several problems and You are looking for 1 solution. What's the controllers? It's kind of a separate problem that You do not formulated.
It is obvious that we are talking about the storage entity and then the question is not only: in one table or in different ways, there still is the option to store different data in json and then one table (perfect for random data which does not sample). And there are surely other options, for example a separate model for each profile with its methods and attributes.
The issue is not solved until You understand how it will be used. As having the necessary methods to work with data, You will be able to understand which method is optimal for this project.
Any good decision is a logical conclusion when considering all of the original data. And You have not provided them and apparently they themselves have not yet formulated.
Good day! Perhaps it is not correctly formulated question. I have already made this decision in different tables and with different controllers. Then came the conversation that it is possible to combine these data intersect. And not intersecting the data to be put in a separate table.

Why is it the controllers? Because you can implement all in one controller and use if, else, + scripts. Or not to split hairs and make a separate....

This will be used as a private office, and on the output in the frontend of the site. Realized that while the data coach and the data of the client. As the coach and the client will use in the bonus system. I don't know how clearly explained

Write what you want in plain Russian... In the admin part of your website has a database of trainers, clients. Each client has their contact details, subscriptions, fees, bonuses.... Each coach has the contact details of the replacement, the group which conducts, salary, bonuses,... These two roles are granted access to the personal Cabinet, where he can see information for the above listed data.

Something like that. I don't know how properly understood. Json is not likely to succeed, as this data will be requested in many places. Easier to do it through the database, than "glue" with the queries from the database. - jacquelyn_Nikolaus84 commented on June 10th 19 at 14:47

Find more questions by tags Yii