Я пытаюсь добавить атрибут «data-image» = «image» path в теги dropdownList
Я хочу это:
<select class="custom-select custom-select-lg mb-3" id="msdrpdd20" tabindex="-1">
<option selected="">Select Fit</option>
<option id="Orders-fit_id" name="Orders[fit_id]" data-image="/w1/backend/web/uploads/fit_image/10/splash.png" value="10">Slim </option>
<option id="Orders-fit_id" name="Orders[fit_id]" data-image="/w1/backend/web/uploads/fit_image/11/encryption-key.jpg" value="11">test1</option> </select>
ЗДЕСЬ мой код:
$listData=ArrayHelper::map($fit_list,'id','name');
echo $form->field($model, 'fit_id')->dropDownList(
$listData,
['options'=>[
'value1' => ['data-target' => 'yourAtt']]]
//['prompt'=>'Select Fit___ssss', 'class'=>'custom-select custom-select-lg mb-3']
)