src/PHPDish/Bundle/ForumBundle/Controller/ThreadController.php
public function editAction($slug, Request $request)
    {
        $thread = $this->getThreadManager()->findThreadBySlug($slug);
        if (!$thread) {
            throw $this->createNotFoundException();
        }
        $this->denyAccessUnlessGranted('edit', $thread);

        $form = $this->createForm(ThreadType::class, $thread);
        $form->handleRequest($request);
        if ($form->isValid() && $form->isSubmitted()) {

            $this->getThreadManager()->saveThread($thread);
            $this->addFlash('success', $this->get('translator')->trans('thread.edit_success'));

            return $this->redirectToRoute('thread_view', [
                'slug' => $thread->getSlug(),
            ]);
        }
        return $this->render($this->configuration->getTemplate('Thread:create.html.twig'), [
            'thread' => $thread,
            'form' => $form->createView()
        ]);
    }
public function editAction($slug, Request $request)
    {
        $thread = $this->getThreadManager()->findThreadBySlug($slug);
        if (!$thread) {
            throw $this->createNotFoundException();
        }
        $this->denyAccessUnlessGranted('edit', $thread);

        $form = $this->createForm(ThreadType::class, $thread);
        $form->handleRequest($request);
        if ($form->isValid() && $form->isSubmitted()) {

            $this->getThreadManager()->saveThread($thread);
            $this->addFlash('success', $this->get('translator')->trans('thread.edit_success'));

            return $this->redirectToRoute('thread_view', [
                'slug' => $thread->getSlug(),
            ]);
        }
        return $this->render($this->configuration->getTemplate('Thread:create.html.twig'), [
            'thread' => $thread,
            'form' => $form->createView()
        ]);
    }
@Route("/threads/{slug}/edit", name="thread_edit")

@param string  $slug
@param Request $request

@return Response