'; $form = ActiveForm::begin(); // ================ // ==== COMMON ==== // ================ echo $form->field($model_pid, 'termin_pid')->widget( Select2::classname(), [ 'data' => ArrayHelper::map( [ [ 'termin_id' => 0, 'termin_title' => 'NONE', ] ] + (new Termin)->finInfo([ 'show_all' => true, 'to_array' => true, ]), 'termin_id', 'termin_title' ), 'options' => ['placeholder' => 'Select a state ...'], 'pluginOptions' => [ 'allowClear' => true ], ] ); echo $form->field($model, 'termin_name')->textInput(['maxlength' => true]); // ============== // ==== LANG ==== // ============== $multilang = Multilang::begin(['ajaxpath' => Url::to(['termin/form']), 'form' => $form, 'data_langs' => $model_lang]); $first = 1; foreach ($model_lang as $index => $data) { echo '
'.$form->field($model_lang[$index], '['.$index.']lang_id')->label(false)->hiddenInput(['value' => $index]).' '.$form->field($model_lang[$index], '['.$index.']termin_title')->textInput().' '.$form->field($model_lang[$index], '['.$index.']termin_alias')->textInput().'
'; $first = 0; } $multilang->end(); /* echo Html::activeHiddenInput ($model_lang, 'lang_id', [ 'value' => ($model_lang->lang_id != 0 ? $model_lang->lang_id : Yii::$app->params['lang_id']), ]); */ // ==== BUTTON ==== echo '
'.Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']).'
'; ActiveForm::end(); echo ''; echo ' ';