ForkCMS\Bundle\InstallerBundle\Form\Handler\ModulesHandler::process PHP Method

process() public method

public process ( Form $form, Request $request ) : boolean
$form Symfony\Component\Form\Form
$request Symfony\Component\HttpFoundation\Request
return boolean
    public function process(Form $form, Request $request)
    {
        if (!$request->isMethod('POST')) {
            return false;
        }
        $form->handleRequest($request);
        if ($form->isValid()) {
            return $this->processValidForm($form, $request);
        }
        return false;
    }

Usage Example

Example #1
0
 public function step3Action(Request $request)
 {
     $this->checkInstall();
     // @todo: check if all data from step 2 is available
     // show modules form
     $form = $this->createForm(new ModulesType(), $this->getInstallationData($request));
     $handler = new ModulesHandler();
     if ($handler->process($form, $request)) {
         return $this->redirect($this->generateUrl('install_step4'));
     }
     return $this->render('ForkCMSInstallerBundle:Installer:step3.html.twig', array('form' => $form->createView()));
 }