Symfony2 invalid form without errors

前端 未结 11 732
孤独总比滥情好
孤独总比滥情好 2020-12-01 01:46

I\'ve got a problem with a Symfony2 generated CRUD form. (With MongoDB Documents, but I do not think that this is related)

In my controller\'s createAction() method,

11条回答
  •  有刺的猬
    2020-12-01 02:16

    For me the form was not submitted, even if I had a submit button. I added the code to solve the problem

    $request = $this->get('request');
    if($request->isMethod("POST")){
          $form->submit($request);
            if($form->isValid()){
            // now true
            }
    }
    

提交回复
热议问题