You are here

public function SettingsForm::submitForm in Opigno dashboard 8

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

Class

SettingsForm
Class SettingsForm.

Namespace

Drupal\opigno_dashboard\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  // Save settings.
  $this
    ->config('opigno_dashboard.settings')
    ->set('blocks', $form_state
    ->getValue('blocks'))
    ->set('theme', $form_state
    ->getValue('theme'))
    ->save();
  $this->blockService
    ->createBlocksInstances($form_state
    ->getValue('blocks'));
  parent::submitForm($form, $form_state);
}