You are here

public function Settings::submitForm in DRD Agent 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Form/Settings.php \Drupal\drd_agent\Form\Settings::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 FormInterface::submitForm

File

src/Form/Settings.php, line 71

Class

Settings
Configure drd-agent settings for this site.

Namespace

Drupal\drd_agent\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $debug_mode = $form_state
    ->getValue('debug_mode');
  $this->state
    ->set('drd_agent.debug_mode', $debug_mode);
  $this
    ->messenger()
    ->addStatus($this
    ->t('Settings saved'));
}