public function deleteAction(Request $request, Post $post)
{
$form = $this->createDeleteForm($post);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager = $this->getDoctrine()->getManager();
$entityManager->remove($post);
$entityManager->flush();
$this->addFlash('success', 'post.deleted_successfully');
}
return $this->redirectToRoute('admin_post_index');
}