public function StylesOverviewForm::submitForm

File

paragraphs_collection/src/Form/StylesOverviewForm.php, line 193

Class

StylesOverviewForm
Provides a form for revision overview page.

Namespace

Drupal\paragraphs_collection\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $enabled_styles = array_keys(array_filter((array) $form_state
    ->getValue('styles'), function ($value) {
    return !empty($value['enabled']);
  }));
  $this->config
    ->set('enabled_styles', $enabled_styles);
  $this->config
    ->save();
}