You are here

public function TermsOfUseForm::submitForm in Terms of Use 8

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 ConfigFormBase::submitForm

File

src/Form/TermsOfUseForm.php, line 137
Contains \Drupal\terms_of_use\Form\TermsOfUseForm.

Class

TermsOfUseForm

Namespace

Drupal\terms_of_use\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $config = $this
    ->config('terms_of_use.settings');
  $node_id = $form_state
    ->getValue('terms_of_use_node_id');
  $fieldset_name = $form_state
    ->getValue('terms_of_use_fieldset_name');
  $checkbox_label = $form_state
    ->getValue('terms_of_use_checkbox_label');
  $config
    ->set('node_id', $node_id)
    ->set('node_title', $this->node_title)
    ->set('fieldset_name', $fieldset_name)
    ->set('checkbox_label', $checkbox_label)
    ->save();
}