You are here

public function ResetTemplatesConfirmForm::submitForm in Easychart 8.3

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 FormInterface::submitForm

File

src/Form/ResetTemplatesConfirmForm.php, line 40
Contains \Drupal\easychart\ResetTemplatesConfirmForm

Class

ResetTemplatesConfirmForm

Namespace

Drupal\easychart\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->configFactory()
    ->getEditable('easychart.settings')
    ->clear('templates')
    ->save();
  drupal_set_message($this
    ->t('The templates have been reset to their default values.'));
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}