public function FormSubmitter::doSubmitForm in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Form/FormSubmitter.php \Drupal\Core\Form\FormSubmitter::doSubmitForm()
- 9 core/lib/Drupal/Core/Form/FormSubmitter.php \Drupal\Core\Form\FormSubmitter::doSubmitForm()
File
- core/lib/Drupal/Core/Form/FormSubmitter.php, line 46
Class
- FormSubmitter
- Provides submission processing for forms.
Namespace
Drupal\Core\Form
Code
public function doSubmitForm(&$form, FormStateInterface &$form_state) {
if (!$form_state
->isSubmitted()) {
return;
}
$this
->executeSubmitHandlers($form, $form_state);
if (($batch =& $this
->batchGet()) && !isset($batch['current_set'])) {
$batch['form_state'] = $form_state;
$batch['progressive'] = !$form_state
->isProgrammed();
$response = batch_process();
if ($batch && $batch['progressive']) {
return $response;
}
}
$form_state
->setExecuted();
if (!$form_state
->getResponse() && ($redirect = $this
->redirectForm($form_state))) {
$form_state
->setResponse($redirect);
}
if (($response = $form_state
->getResponse()) && $response instanceof Response) {
return $response;
}
}