<div class="teachers-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'teacher_name')->textInput(['maxlength' => 150]); ?> <?php echo $form->field($model, 'id_position')->DropDownList(ArrayHelper::map(TeachersPosition::find()->all(), 'position_id', 'position_name')); ?> <?php echo $form->field($model, 'id_academic_status')->DropDownList(ArrayHelper::map(TeachersAcademicStatus::find()->all(), 'academic_status_id', 'academic_status_name')); ?> <?php echo Html::label("Кафедра"); echo Select2::widget(['model' => $model, 'attribute' => 'id_cathedra', 'language' => 'ru', 'data' => $all_cathedra]); ?> <?php echo $form->field($model, 'teacher_other_cathedra')->widget(Select2::classname(), ['data' => $all_cathedra, 'language' => 'uk', 'pluginOptions' => ['allowClear' => true], 'options' => ['multiple' => true]])->label('Додаткові кафедри'); ?> <br/> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Створити' : 'Оновити', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
/** * @return \yii\db\ActiveQuery */ public function getAcademicStatus() { return $this->hasOne(TeachersAcademicStatus::className(), ['academic_status_id' => 'id_academic_status']); }