I have three tables
-
products,
-
sites and
-
product_sites with columns product_id and site_id.
1st question. How should I configure the input form of the products to have a listbox on the form which I choose 1 or 2 sites for the new product?
2nd question. How should I modify the controller function actionCreate,
I want the inserted records in table product_sites will be 2, i.e. the first row product_id 1700 site_id 1 and the second row product_id 1700 site_id 2. yii 1.1.15. The model relation of products and sites are many to many.