/** * @Route("/remove/{tag}", name="tag_remove",options={"expose"=true}) * @param Tag $tag * @ParamConverter("tag", class="AppBundle:Tag") * @return Response */ public function removeAction(Request $request, Tag $tag) { //todo send confimration message if ($tag->isRemovable()) { $em = $this->getDoctrine()->getEntityManager(); $em->remove($tag); $em->flush(); } return $this->redirect($this->generateUrl('tag_list')); }