Symfony2: Access the container in the repository

后端 未结 2 1207
遇见更好的自我
遇见更好的自我 2020-12-19 19:38

I\'m trying to show an user oriented choice list in a form and I don\'t manage to access to the container to get the current User.

I don\'t see how to get it in the

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-19 20:09

    Perhaps you can request the User object in the controller, and pass it on to the repository in the constructor?

提交回复
热议问题