Answer the question
In order to leave comments, you need to log in
Yii2 Dropdown list when creating a new post in admin?
Hello.
I have tables: catalog(Laptop), partition(Asus), product(ASUS X553MA-XX490D). The section is associated with the catalog and the product is associated with the section. Through CRUD, everything was generated and working.
But how to make it so that when you create a new record in the product in the Catalog_id field there is a drop-down list with sections (Asus, Lenovo, HP)? Or even take a value from a directory like Laptop->Samsung or Monitor->Samsung. It's just that the database lacks the same firms of different products.
Now, in the Catalog_id text field, you need to enter a number that corresponds to the id_product of the Product table.
It is clear that you need to pull a query from the database with a value and a key, and display it through select, but how to implement this in Yii2?
Can someone explain what and where to write?
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question