Reputation: 19
<?= $form->field($model, 'SRF_STUDENT_ID')->dropdownList(
ArrayHelper::map(StudentDetails::find()->all(),'STUDENT_REGISTRATION_ID','STUDENT_REGISTRATION_ID'),
['prompt'=>'Select Student Id']); ?>
how to set where condition in the dropdownlist. i want select STUDENT_REGISTRATION_ID from StudentDetails where is_select = 0; data result set dropdownlist. please give me your help.
Upvotes: 1
Views: 68
Reputation: 9358
Try this:
<?= $form->field($model, 'SRF_STUDENT_ID')->dropdownList(
ArrayHelper::map(StudentDetails::find()->where(['is_select' => 0])->all(),'STUDENT_REGISTRATION_ID','STUDENT_REGISTRATION_ID'),
['prompt'=>'Select Student Id']); ?>
Upvotes: 1