Ojs\AdminBundle\Controller\AdminJournalApplicationFileController::createAction PHP Method

createAction() public method

Creates a new Index entity.
public createAction ( Request $request ) : RedirectResponse | Response
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\RedirectResponse | Symfony\Component\HttpFoundation\Response
    public function createAction(Request $request)
    {
        $entity = new JournalApplicationFile();
        $form = $this->createCreateForm($entity)->add('create', 'submit', array('label' => 'c'));
        $form->handleRequest($request);
        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($entity);
            $em->flush();
            $this->successFlashBag('successful.create');
            return $this->redirectToRoute('ojs_admin_application_file_show', ['id' => $entity->getId()]);
        }
        return $this->render('OjsAdminBundle:AdminJournalApplicationFile:new.html.twig', array('entity' => $entity, 'form' => $form->createView()));
    }