我已经链接了表格,当我创建像这样的下拉列表时
<?= $form->field($model, 'player_id')->dropDownList(
ArrayHelper::map(Player::find()->all(), 'id', 'category_id'),
['prompt' => 'Select'])
?>
它有效。
我需要在我的列表类别名称而不是类别ID(表category
包含id
和name
,而category_id
来自我当前表的category.id
链接到{{1 }})
我该怎么做?