$form = $this->createFormBuilder($entity) ->setAction($this->generateUrl($request->get('_route'))) ->add('name', TextType::class) ->add('email', EmailType::class) ->add('submit', SubmitType::class) ->getForm();
$form = $this->createFormBuilder($entity) ->setAction('/custom-url') ->add('name', TextType::class) ->add('email', EmailType::class) ->add('submit', SubmitType::class) ->getForm();In this example, the setAction method is used to set the form action to a custom URL. The Symfony component that provides the FormBuilderInterface is "symfony/form".