public function SCNSettingsForm::submitForm in Simple Comment Notify 8
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/ SCNSettingsForm.php, line 122
Class
- SCNSettingsForm
- Defines a form that configures forms module settings.
Namespace
Drupal\scn\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$values = $form_state
->getValues();
$this
->config('scn.settings')
->set('scn_admin', $values['scn_admin'])
->set('scn_roles', $values['scn_roles'])
->set('scn_maillist', $values['scn_maillist'])
->set('scn_telegram', $values['scn_telegram'])
->set('scn_telegram_bottoken', $values['scn_telegram_bottoken'])
->set('scn_telegram_chatids', $values['scn_telegram_chatids'])
->set('scn_telegram_proxy', $values['scn_telegram_proxy'])
->set('scn_telegram_proxy_server', $values['scn_telegram_proxy_server'])
->set('scn_telegram_proxy_login', $values['scn_telegram_proxy_login'])
->set('scn_telegram_proxy_password', $values['scn_telegram_proxy_password'])
->save();
$this
->messenger()
->addMessage($this
->t('The configuration options have been saved.'));
}