I get a message : "Oops! An Error Occurred The server returned a "500 Internal Server Error". Something is broken. Please e-mail us at [email] and let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused" when persisting data to a database. Here is a controller:
public function registerAction()
{
$register = new Register();
$form = $this->createForm(new RegisterType(), $register);
$request = $this->getRequest();
if ($request->getMethod() == 'POST')
{
$form->bindRequest($request);
if ($form->isValid())
{
$em = $this->getDoctrine()->getEntityManager();
$em->persist($register);
$em->flush();
return $this->redirect($this->generateUrl('ShopMyShopBundle_register'));
}
}
return $this->render('ShopMyShopBundle:Main:register.html.twig', array('form' => $form->createView()));
}
Where is the problem ?