public function addAction(HttpFoundation\Request $request)
{
$post = new Entity\Post();
$form = $this->createForm(new Form\PostType(), $post);
if( $request->isMethod('POST') && $form->bind($request)->isValid() ) {
$post = $form->getData()->setAddDate();
$em = $this->getDoctrine()->getManager();
$em->persist($post);
$em->flush();
return $this->redirect($this->generateUrl('show', array('id' => $post->getId())));
}
return $this->render('SiteDeskBundle:Post:add.html.twig', array('form' => $form->createView()));
}