M
M
Mikhail Zakharov2016-04-06 16:10:44
Yii
Mikhail Zakharov, 2016-04-06 16:10:44

How to make a record in 3 tables in Yii2?

There are three tables:
property - real estate objects (id, name, ....)
property_props - properties of real estate objects (id, name)
property_props_values ​​- property values ​​(id, property_id, prop_id, value) You
need to do 2 things:
1. In the form edit (_form.php) it is necessary to display properties from the property_props table
2. When saving a property, it is necessary to write the property value to the property_props_values ​​table
Leave links to examples of such implementation or suggest a better option

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Bukharev, 2016-04-06
@werwolf87

Many To Many relationship, there is a description in the official documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question