for my drop-down list I am using this code.
= $form->field($medicinerequest, \'[\' . $id . \']\' . \'medicine_name\') ->DropDownList(ArrayHelper::
The anonymous function could be
function ($element) { return $element['medicine_name'] . '-'. $element['medicine_id']; }
You can check here!