Answer the question
In order to leave comments, you need to log in
Yii2 dynamically created dropdown lists via foreach?
Hello, I need advice... Probably even an explanation...
Guided by this article
With this representation of _form:
foreach ($tableFromTemplate as $index => $setting) {
echo $form->field($setting, '[$index]id_table')->dropDownList(
ArrayHelper::map($tableDesc, 'id', 'tag_table_desc')
)->label(false);
foreach ($tableFromTemplate as $index => $setting) {
echo $form->field($setting, "[$index]id_table")->label($setting->id_table);
} ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question