我需要在输入字段中添加一个带有禁用值的占位符。我做错了什么?
<?= $form->field($category, 'id')->dropDownList($categoryList, [
'options' => ['id'=>'category-id'],
'placeholder' => 'Select category', [
'disabled' => true,
]
]); ?>
答案 0 :(得分:0)
<?= $form->field($category, 'id')->dropDownList($categoryList,
[
'id'=>'category-id',
'prompt' => 'Select category',
// This is experimental
'options' => [
'' => ['disabled' => true],
]
]
); ?>