You are here

public function WebformDevelSubmissionApiForm::submitForm in Webform 6.x

Same name and namespace in other branches
  1. 8.5 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 162

Class

WebformDevelSubmissionApiForm
Form used to test programmatic submissions of webforms.

Namespace

Drupal\webform_devel\Form

Code

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(),
  ]));
}