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' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -