1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
public function uploadAction()
{
$document = New Document();
$form = $this->createFormBuilder($document)
->add('file', 'file', array("attr" => (array ('multiple' => 'multiple')),))
->getForm();
if ($this->getRequest()->isMethod('POST')) {
$form->handleRequest($this->getRequest());
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($document);
$em->flush();
return $this->render('GestionFluBundle:Default:add.html.twig', array ('form' => $form->createView()));
} |
Partager