I have two (or more) related tables with a many to many relationship. I want to have one form to collect data from the user for these tables, and one page to display the data to the user. My proposed design is as follows:
-
Generate an active record model for each table using gii.
-
Write my own model which represents the data as the user will see it, and which will communicate with the active record models.
-
Use my own model to generate a controller and views using gii.
-
Edit the controller to get the UserID from the session data and send it to my model, and in turn to the active record models, and then the database.
-
Edit the views
What are the communities opinions on this approach? Have I correctly understood MVC and the yii framework? Will this work? Is this a good design? And is this best practice?