I have a method that creates a form like this:
class search {
public function index() {}
public function createSearch() {
$form = $this->createFormBuilder(null)
->add(...)
->add('search', SubmitType::class, ['attr' => 'action' => 'http://foo.bar/tar'])->getForm();
return $this->render(...);
}
}
As you can see I want the createSearch to create a form that will submit into url 'http://foo.bar/tar' but when submit the form it does not go to that page