src/Sedona/SBORuntimeBundle/Controller/BaseCrudController.php
protected function manageNew($entity, Request $request, $formTypeFQCN)
    {
        $form = $this->createForm($formTypeFQCN, $entity, array(
            'action' => $this->getNewUrl($entity),
            'method' => 'POST',
        ));

        $form
            ->add('create', submitType::class, array('attr' => array('class' => 'btn btn-primary')));

        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            return $this->crudManage($entity, AdminCrudEvent::CREATE);
        }

        return $this->render(
            $this->getNewTemplate(),
            array(
                'entity' => $entity,
                'form' => $form->createView(),
            ));
    }
protected function manageNew($entity, Request $request, $formTypeFQCN)
    {
        $form = $this->createForm($formTypeFQCN, $entity, array(
            'action' => $this->getNewUrl($entity),
            'method' => 'POST',
        ));

        $form
            ->add('create', submitType::class, array('attr' => array('class' => 'btn btn-primary')));

        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            return $this->crudManage($entity, AdminCrudEvent::CREATE);
        }

        return $this->render(
            $this->getNewTemplate(),
            array(
                'entity' => $entity,
                'form' => $form->createView(),
            ));
    }
protected function manageNew ( $ entity , Request $ request , $ formTypeFQCN ) { $ form = $ this -> createForm ( $ formTypeFQCN , $ entity , array ( 'action' => $ this -> getNewUrl ( $ entity ) , 'method' => 'POST' , ) ) ; $ form -> add ( 'create' , submitType :: class , array ( 'attr' => array ( 'class' => 'btn btn-primary' ) ) ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) && $ form -> isValid ( ) ) { return $ this -> crudManage ( $ entity , AdminCrudEvent :: CREATE ) ; } return $ this -> render ( $ this -> getNewTemplate ( ) , array ( 'entity' => $ entity , 'form' => $ form -> createView ( ) , ) ) ; }
Generic new controller helper.

@param $entity
@param Request $request

@return string|\Symfony\Component\HttpFoundation\RedirectResponse
Generic new controller helper .