public function DefaultForm::submitForm in Notify 8
Same name and namespace in other branches
- 2.0.x src/Form/DefaultForm.php \Drupal\notify\Form\DefaultForm::submitForm()
- 1.0.x src/Form/DefaultForm.php \Drupal\notify\Form\DefaultForm::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/ DefaultForm.php, line 162
Class
- DefaultForm
- Defines a form that configures forms module settings.
Namespace
Drupal\notify\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$values = $form_state
->getValues();
$this
->config('notify.settings')
->set('notify_reg_default', $values['notify_reg_default'])
->set('notify_def_node', $values['node'])
->set('notify_def_comment', $values['comment'])
->set('notify_def_teasers', $values['teasers'])
->set('notify_nodetypes', $values['notify_nodetypes'])
->save();
$this->messenger
->addMessage($this
->t('Notify default settings saved.'));
}