public function GeneralForm::submitForm in Frequently Asked Questions 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/ GeneralForm.php, line 64
Class
- GeneralForm
- Form for the FAQ settings page - general tab.
Namespace
Drupal\faq\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
// Remove unnecessary values.
$form_state
->cleanValues();
$this
->configFactory()
->getEditable('faq.settings')
->set('title', $form_state
->getValue('faq_title'))
->set('description', $form_state
->getValue('faq_description'))
->set('custom_breadcrumbs', $form_state
->getValue('faq_custom_breadcrumbs'))
->save();
parent::submitForm($form, $form_state);
}