I'm trying to fix a form that was created using a twig template. The form was not working because there was no action, nor was the form created using FormStateInterface
. It's just a block that is rendering a template.
In this module there is a controller and in this controller a method that handles the form submission using \Drupal::request()->request->all()
which should be the same as using $_POST['']
, correct?
Could I not just do something like this:
<form method="POST" action="/route/to/controller/method">
if I'm wanting to use a custom form template?
I would really just like to know if this is an acceptable practice in the Drupal universe.
$form_state->setRedirect('route...');
. But since its a vanilla HTML form, Drupal has no idea it even exists. Custom form templates are secondary.