You are here

public function CoffeeConfigurationForm::submitForm in Coffee 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/CoffeeConfigurationForm.php, line 60

Class

CoffeeConfigurationForm
Configure Coffee for this site.

Namespace

Drupal\coffee\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  $this
    ->config('coffee.configuration')
    ->set('coffee_menus', array_filter($values['coffee_menus']))
    ->set('max_results', $values['max_results'])
    ->save();
  parent::submitForm($form, $form_state);
}