public function WebformDevelSubmissionApiForm::submitForm in Webform 8.5
Same name and namespace in other branches
- 6.x modules/webform_devel/src/Form/WebformDevelSubmissionApiForm.php \Drupal\webform_devel\Form\WebformDevelSubmissionApiForm::submitForm()
Form submission handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormInterface::submitForm
File
- modules/
webform_devel/ src/ Form/ WebformDevelSubmissionApiForm.php, line 185
Class
- WebformDevelSubmissionApiForm
- Form used to test programmatic submissions of webforms.
Namespace
Drupal\webform_devel\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$values = $form_state
->getValue('values');
$webform_submission = WebformSubmissionForm::submitFormValues($values);
$this
->messenger()
->addStatus($this
->t('New submission %title added.', [
'%title' => $webform_submission
->label(),
]));
}