You are here

public function SettingsForm::submitForm in Simple Google Custom Search Engine 8

Same name and namespace in other branches
  1. 2.0.x src/Form/SettingsForm.php \Drupal\simple_gse_search\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 46

Class

SettingsForm
Defines a settings form for administering Simple CSE search.

Namespace

Drupal\simple_gse_search\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $gse_settings = $this
    ->config('simple_gse_search.settings');
  $gse_settings
    ->set('cx', $form_state
    ->getValue('cx'))
    ->save();
  parent::submitForm($form, $form_state);
}