Answer the question
In order to leave comments, you need to log in
How to save linked model?
Standard question start
I can't figure it out. It is necessary to save a multilingual form, in which there may or may not be more than one language taken from the Lang model
$model = new Settings();
$model_lang = new SettingsLang();
$lang_array = Lang::find()->all();
<?php $form = ActiveForm::begin(); ?>
<?php
foreach ($lang_array as $key => $value) {
echo $value->name;
?>
<?= $form->field($model_lang, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model_lang, 'full_name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model_lang, 'address')->textInput(['maxlength' => true]) ?>
<?= $form->field($model_lang, 'bank_detail_bank_name')->textInput(['maxlength' => true]) ?>
<?php } ?>
<?= $form->field($model, 'main_email')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'license_number')->textInput(['maxlength' => true]) ?>
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