The entry in several tables (models) in Yii 2. How to implement?

Make the articles module (with multilingual support) - on this article habrahabr.ru/post/226931
Therefore, I have two tables ".....
Table post(Post model) — stored meta-information, which is not related to the content. That is, such fields: id, owner_id, date_create, date_update.
Table post_lang(model PostLang) — linking content across languages. Fields: id, post_id, lang_id, name, description. Fields respectively post_id is the id of the post table, lang_id is the id from the table lang. name and description of the content in the appropriate language. ...."
How to do when creating articles, write directly in the two models?
Ie I want to record information when you create and Post, and PostLang to id.post = post_id.postlang.
September 26th 19 at 06:37
1 answer
September 26th 19 at 06:39
You need to normalize the data. You can then use something like this:
https://github.com/yiisoft/yii2/blob/master/docs/g...
What do you mean by "normalize"? (I know databases, I'm in a particular case mean) - jules.Deck commented on September 26th 19 at 06:42
Sori, I did not notice that you were not lang and lang_id. Would call then a PageTranslation model.

In any case, link and save. - Joel.Wisoky36 commented on September 26th 19 at 06:45

Find more questions by tags PHPYii