You are here

public function MathjaxSettingsForm::submitForm in MathJax: LaTeX for Drupal 8.2

Same name and namespace in other branches
  1. 3.0.x src/Form/MathjaxSettingsForm.php \Drupal\mathjax\Form\MathjaxSettingsForm::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/MathjaxSettingsForm.php, line 129

Class

MathjaxSettingsForm
Presents the module settings form.

Namespace

Drupal\mathjax\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('mathjax.settings')
    ->set('use_cdn', $form_state
    ->getValue('use_cdn'))
    ->set('cdn_url', $form_state
    ->getValue('cdn_url'))
    ->set('config_type', $form_state
    ->getValue('config_type'))
    ->set('config_string', $form_state
    ->getValue('config_string'))
    ->set('enable_for_admin', $form_state
    ->getValue('enable_for_admin'))
    ->save();
  drupal_flush_all_caches();
  parent::submitForm($form, $form_state);
}