<div class="matapelajaran-guru-form"> <?php $form = ActiveForm::begin(['method' => 'post', 'action' => $model->isNewRecord ? ['create'] : ['update', 'id' => $model->id_matapelajaran_guru]]); ?> <div class="row"> <div class="col-sm-3"> <!-- ?= $form->field($model,'nip')->dropDownList( \app\models\Data::guru(), ['prompt'=>'Pilih Guru...'])->label('Guru'); ?> --> <?php // Normal select with ActiveForm & model echo $form->field($model, 'nip')->widget(Select2::classname(), ['data' => \app\models\Data::guru(), 'language' => 'en', 'options' => ['placeholder' => 'Pilih Guru...'], 'pluginOptions' => ['allowClear' => true]])->label('Guru Pengampu'); ?> <?php //$form->field($model, 'nip')->textInput(['maxlength' => true]) ?> <?php //$form->field($model, 'id_matapelajaran')->textInput() ?> <!-- ?= $form->field($model,'id_matapelajaran')->dropDownList( \app\models\Data::matapelajaran(), ['prompt'=>'Pilih Mata Pelajaran...'])->label('Mata Pelajaran'); ?> --> <?php // Normal select with ActiveForm & model echo $form->field($model, 'id_matapelajaran')->widget(Select2::classname(), ['data' => \app\models\Data::matapelajaran(), 'language' => 'en', 'options' => ['placeholder' => 'Pilih Mata Pelajaran...'], 'pluginOptions' => ['allowClear' => true]])->label('Mata Pelajaran'); ?>