You are here

public function BetterSearchSettingsForm::submitForm in Better Search Block 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/BetterSearchSettingsForm.php, line 112

Class

BetterSearchSettingsForm
Displays the better_search settings form.

Namespace

Drupal\better_search\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('better_search.settings')
    ->set('placeholder_text', $form_state
    ->getValue('placeholder_text'));
  $config
    ->set('theme', $form_state
    ->getValue('theme'));
  $config
    ->set('size', $form_state
    ->getValue('size'));
  $config
    ->set('searchpage_enable', $form_state
    ->getValue('searchpage_enable'));
  $config
    ->set('searchpage_submit_not_visible', $form_state
    ->getValue('searchpage_submit_not_visible'));
  $config
    ->save();
  parent::submitForm($form, $form_state);
}