Answer the question
In order to leave comments, you need to log in
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
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question