I have action, but when i send data, i have
Request-URI Too Long. The requested URL's length exceeds the capacity limit for this server
public function addAction(Request $request)
{
$productGallery = new ProductGallery();
$product = new Product();
$productGallery->addProductgalleryToProduct($product);
$form = $this->createForm(new ProductGalleryType(), $productGallery);
if($request->isMethod('POST'))
{
$form->handleRequest($request);
if($form->isValid())
{
$em = $this->getDoctrine()->getManager();
$em->persist($productGallery);
$em->persist($product);
$em->flush();
return $this->redirectToRoute('addAction', array('form' => $form->createView()));
}
}
return array(
'form' => $form->createView()
);
}
How i can fixed it? What i do wrong?
p.s my form collection
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('productgallery_to_product', 'collection', array(
'type' => new ProductType(),
'allow_add' => true,
'by_reference' => false,
'allow_delete' => true,
'prototype' => true
))
;
}
NEW INFO
Method 'POST' In my url