here i want to select Airline from a list this is the code:
<div class="col-lg-2"> <?= $form->field($model, 'Airline') ?> </div> <div class="col-lg-2"> <?= Html::label('Bdate', 'Bdate') ?> <?= Html::activeInput('date', $model ,'Bdate',['class'=>'form-control']) ?> </div>
Advertisement
Answer
<?= $form->field($model, 'some_column')->dropdownList(['1' => 'aaa', '2' => 'bbb'], ['prompt' => '---Select Data---']) ?>
here is yii2 dropdown’s simplest view