You are here

public function BlockUploadSettingsForm::submitForm in Block Upload 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/BlockUploadSettingsForm.php, line 43

Class

BlockUploadSettingsForm
Module configuration form.

Namespace

Drupal\block_upload\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $blocks_count = $form_state
    ->getValue('block_upload_blocks_count');
  $this
    ->config('block_upload.settings')
    ->set('blocks_count', $blocks_count)
    ->save();
  \Drupal::state()
    ->set('block_upload_count', $blocks_count);
  parent::submitForm($form, $form_state);
  drupal_flush_all_caches();
}