S
S
Sergey Evstigneev2016-07-07 11:39:20
Yii
Sergey Evstigneev, 2016-07-07 11:39:20

Multilingual blog in Yii2. How to organize the work of the form?

Yii2
In the database we have:
tabe 'post' (id, img, status, .... )
table 'post_lang' (id, post_id, lang_id, name, text)
table 'lang' (id, lang)
In view we have a form with all fields of the post, including language dependent ones. All in one form. Can you suggest a solution for writing to the database? There are no problems with the monolingual version (when everything is in one table), but there is a problem with the multilingual version.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Toey, 2016-07-07
@Toey

collect all the data from the form,
and in Post(Model) in afterSave add entries for the languages ​​with which it is associated.
add an entry to PostLang

S
Skrolea, 2016-07-07
@Skrolea

Look here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question