protected function SessionExampleForm::invalidateCacheTag in Examples for Developers 8
Same name and namespace in other branches
- 3.x modules/session_example/src/Form/SessionExampleForm.php \Drupal\session_example\Form\SessionExampleForm::invalidateCacheTag()
Invalidate the cache tag for this session.
The form will use this method to invalidate the cache tag when the user updates their information in the submit handlers.
2 calls to SessionExampleForm::invalidateCacheTag()
- SessionExampleForm::submitClearSession in session_example/
src/ Form/ SessionExampleForm.php - Remove all the session information.
- SessionExampleForm::submitForm in session_example/
src/ Form/ SessionExampleForm.php - Form submission handler.
File
- session_example/
src/ Form/ SessionExampleForm.php, line 192
Class
- SessionExampleForm
- Form to allow the user to store information in their session.
Namespace
Drupal\session_example\FormCode
protected function invalidateCacheTag() {
$this->cacheTagInvalidator
->invalidateTags([
'session_example:' . $this->session
->getId(),
]);
}