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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -