function UserLogoutConfirm::submitForm
Same name and namespace in other branches
- 11.x core/modules/user/src/Form/UserLogoutConfirm.php \Drupal\user\Form\UserLogoutConfirm::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
-
core/
modules/ user/ src/ Form/ UserLogoutConfirm.php, line 49
Class
- UserLogoutConfirm
- Provides a confirmation form for user logout.
Namespace
Drupal\user\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) : void {
user_logout();
$form_state->setRedirect('<front>');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.