public function XmlSitemapCustomEditForm::submitForm in XML sitemap 8
Same name and namespace in other branches
- 2.x xmlsitemap_custom/src/Form/XmlSitemapCustomEditForm.php \Drupal\xmlsitemap_custom\Form\XmlSitemapCustomEditForm::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
- xmlsitemap_custom/
src/ Form/ XmlSitemapCustomEditForm.php, line 200
Class
- XmlSitemapCustomEditForm
- Provides a form for editing a custom link.
Namespace
Drupal\xmlsitemap_custom\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$form_state
->cleanValues();
$link = $form_state
->getValues();
$this->linkStorage
->save($link);
$this
->messenger()
->addStatus($this
->t('The custom link for %loc was saved.', [
'%loc' => $link['loc'],
]));
$form_state
->setRedirect('xmlsitemap_custom.list');
}