You are here

public function SettingsForm::submitForm in Lightning API 8

Same name and namespace in other branches
  1. 8.4 src/Form/SettingsForm.php \Drupal\lightning_api\Form\SettingsForm::submitForm()
  2. 8.2 src/Form/SettingsForm.php \Drupal\lightning_api\Form\SettingsForm::submitForm()
  3. 8.3 src/Form/SettingsForm.php \Drupal\lightning_api\Form\SettingsForm::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 ConfigFormBase::submitForm

File

src/Form/SettingsForm.php, line 49

Class

SettingsForm
The settings form for controlling Content API's behavior.

Namespace

Drupal\lightning_api\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('lightning_api.settings')
    ->set('entity_json', (bool) $form_state
    ->getValue('entity_json'))
    ->set('bundle_docs', (bool) $form_state
    ->getValue('bundle_docs'))
    ->save();
  parent::submitForm($form, $form_state);
}