如何在symfony 4中显示一个包含从关系数据库中获取的数据的表单作为下拉列表?
问题描述:
Guide me suggestions to have a drop down with data's fetched from relational database in symfony 4
Referral link:
答
In Controller
Add this line
$category = $this->getDoctrine() ->getRepository(Category::class) ->findAll();
In Twig