Calls to isSumbitted() and isValid() result in “undefined method” error
问题 I have a Symfony form that is created from createFormBuilder() in the controller. But under two IF statements the form should carry two different set of fields. My Symfony version is 3.4. /src/AppBundle/Controller/DefaultController.php Ex: This is the basic form. $form = $this->createFormBuilder() ->add('name', TextType::class, ['required' => true]]) ->add('email', EmailType::class, ['required' => true]]) ->getForm(); if ($form->isSubmitted() && $form->isValid()) { ... ... ... } Now I need to