With Symfony 3, I use ParamConverter and custom a method in my repository : " getPicture() ".
/**
* @Route("/picture/edit/{id}/{slug}", requirements={"id": "\d+"}, name="my_picture_edit")
* @ParamConverter("picture", options={
* "repository_method" = "getPicture",
* "mapping": {"id": "id", "slug": "slug"},
* "map_method_signature" = true
* })
* @Method({"GET", "POST"})
*/
public function pictureEditAction(Request $request, UserPicture $picture)
{
...
But I want to pass current user authenticated in the method " getPicture() ". Is it possible ?
Thank you very much :)