Example #1
0
 /**
  * @Route("/articles/{legacyId}", requirements={"legacyId": "\d+"})
  * @ParamConverter("article", options={"mapping": {"legacyId": "legacyId"}, "entity_manager" = "default"})
  */
 public function showLegacyArticleAction(Article $article)
 {
     $this->addFlash('notice', sprintf('La nouvelle URL de cet article est : %s', $this->generateUrl('app_article_show', array('slug' => $article->getSlug()), true)));
     return $this->redirectToRoute('app_article_show', array('slug' => $article->getSlug()), Response::HTTP_MOVED_PERMANENTLY);
 }
Example #2
0
 private function createDeleteForm(Article $article)
 {
     return $this->createFormBuilder()->setAction($this->generateUrl('admin_article_delete', array('slug' => $article->getSlug())))->setMethod('DELETE')->getForm();
 }
 /**
  * Delete a comment
  * @param Article $article
  * @param Comment $comment
  * @return \Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function deleteAction(Article $article, Comment $comment)
 {
     $this->commentService->delete($comment);
     return $this->redirect($this->generateUrl('article_view', array('slug' => $article->getSlug())));
 }