Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function uploadAction() {
- $document = new \Repo\RepoBundle\Entity\RepoFile();
- $document->setAuthor(4449);
- $form = $this->createFormBuilder($document)
- ->add('file')
- ->getForm()
- ;
- if ($this->getRequest()->isMethod('POST')) {
- $form->bind($this->getRequest());
- if ($form->isValid()) {
- $em = $this->getDoctrine()->getManager();
- var_dump($document->author);
- $em->persist($document);
- $em->flush();
- return $this->redirect('Repo_Strategy_upload');
- }
- }
- return $this->render('RepoRepoBundle:Strategy:upload.html.twig', array('form' => $form->createView()));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement