duanen19871021 2018-05-11 11:29
浏览 33
已采纳

如何在symfony 4中显示一个包含从关系数据库中获取的数据的表单作为下拉列表?

Guide me suggestions to have a drop down with data's fetched from relational database in symfony 4

Referral link:

Relational Database

  • 写回答

1条回答 默认 最新

  • dtfbj24048 2018-05-11 13:45
    关注

    In Controller

    Add this line

    $category = $this->getDoctrine() ->getRepository(Category::class) ->findAll();

    In Twig

    Add these lines in your twig

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?