php - Display dropdownlist filter data? -


<?= $form->field($model, 'srf_student_id')->dropdownlist(                     arrayhelper::map(studentdetails::find()->all(),'student_registration_id','student_registration_id'),                     ['prompt'=>'select student id']); ?> 

how set condition in dropdownlist. want select student_registration_id studentdetails is_select = 0; data result set dropdownlist. please give me help.

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']); ?> 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -