2

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 :)

Gaylord.P
  • 1,539
  • 2
  • 24
  • 54
  • 3
    create your own [paramconverter](http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html#creating-a-converter) – Matteo Apr 24 '17 at 19:31

0 Answers0