A
A
Alexander Stepanov2017-09-01 12:14:45
Yii
Alexander Stepanov, 2017-09-01 12:14:45

How to create form fields (select, checkboxList...) in multilingual Yii2?

There is a multilingual site on yii2-advanced and you need to make a registration form, but by standard means only the first level table is displayed. Without translation.
The database structure is: item, item_lang - it refers to item and you can add any number of languages.
To display elements, $item->content->title is called, and this construction cannot be inserted into <?= $form->field($model, 'item')->dropDownList() ?>
Please tell me how it and where to turn to win?
Maybe you need to show some more data?
I made a multilanguage according to an article from Habr

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mykola, 2017-09-01
@Exebeche

Collect an array with translated values ​​in the controller and then feed it into a dropDownList

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question