When dealing with some complex data, it is possible that you may need to use multiple different models to collect the user input. For example, you have an order form with user information such as first name, last name, and phone number; you also have a delivery address and some kind of product.
You would like to save all this data in one form. With Yii models and support forms, you can easily do this. Assuming that the user info will be stored in the user table and in the order form, we will save product information and the user_id
of the user who has ordered a product. We also have a product table with some information in it.
Create a new application by using the Composer package manger, as described in the official guide at http://www.yiiframework.com/doc-2.0/guide-start-installation.html.
Create migrations for contest and prize tables with the following commands:
./yii migrate/create create_order_tables
Update the newly-created migration's
up...