public function addAction(Request $request) { $user = new Users(); $form = $this->createFormBuilder($user) ->add('name', 'text') ->add('username', 'text') ->getForm(); $form->bindRequest($request); if ($request->getMethod() == 'POST') { $em = $this->getDoctrine()->getEntityManager(); $em->persist($form->getData()); $em->flush(); } else { } }
dlaczego wyświetla mi się formularz z napisem error ?, na pewno metoda formularza jest post.
oraz chce wyświetlić np samo imię i żaden z tych niżej nie działa.
$this->get('request')->request->get('name'); $request->request->get('name');
coś źle robie? proszę o wskazówki i porady

oczywiście mam dołączone
use Symfony\Component\HttpFoundation\Request;