You are here

function icon_select_vocabulary_form_submit in Icon Select 8

Custom submit handler for updating / saving icon vocabulary.

1 string reference to 'icon_select_vocabulary_form_submit'
icon_select_form_taxonomy_vocabulary_form_alter in ./icon_select.module
Implements hook_form_FORM_ID_alter().

File

./icon_select.module, line 92
Basic module file for icon_select module.

Code

function icon_select_vocabulary_form_submit(&$form, FormStateInterface $form_state) {
  $config = \Drupal::service('config.factory')
    ->getEditable('icon_select.settings');
  $path = $form_state
    ->getValue('path');

  // Set and save new path value.
  $config
    ->set('path', $path)
    ->save();

  // Update sprites.
  SvgSpriteGenerator::generateSprites('icons');
}