You are here

public function Settings::submitForm in DRD Agent 8.3

Same name and namespace in other branches
  1. 4.0.x 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 ConfigFormBase::submitForm

File

src/Form/Settings.php, line 45

Class

Settings
Configure drd-agent settings for this site.

Namespace

Drupal\drd_agent\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->configFactory()
    ->getEditable('drd_agent.settings');
  $form_state
    ->cleanValues();
  foreach ($form_state
    ->getValues() as $key => $value) {
    $config
      ->set($key, $value);
  }
  $config
    ->save();
  parent::submitForm($form, $form_state);
}