You are here

public function WebformUiElementTypeFormBase::submitForm in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_ui/src/Form/WebformUiElementTypeFormBase.php \Drupal\webform_ui\Form\WebformUiElementTypeFormBase::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_ui/src/Form/WebformUiElementTypeFormBase.php, line 145

Class

WebformUiElementTypeFormBase
Provides a abstract element type webform for a webform element.

Namespace

Drupal\webform_ui\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $preview = $this->userData
    ->get('webform_ui', $this->currentUser
    ->id(), 'element_type_preview') ?: FALSE;
  $this->userData
    ->set('webform_ui', $this->currentUser
    ->id(), 'element_type_preview', !$preview);
  $form_state
    ->clearErrors();
  $form_state
    ->setRebuild();
}