/** * @Route("/{id}", name="homepage") */ public function indexAction(Request $request, Abogado $abogado) { $formAbogado = new Abogado(); $form = $this->createFormBuilder($formAbogado)->setAction($this->generateUrl('homepage', array('id' => $abogado->getId())))->add('nombre')->add('dni')->getForm(); $form->handleRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); $em->persist($formAbogado); $em->flush(); } $abogados = $this->getDoctrine()->getRepository('AppBundle:Abogado')->findAll(); return $this->render('front/index.html.twig', ['abogados' => $abogados, 'abogado' => $abogado, 'form' => $form->createView()]); }
/** * {@inheritDoc} */ public function getCreatedAt() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getCreatedAt', []); return parent::getCreatedAt(); }