This repository has been archived on 2025-01-19. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
drupalcampbristol/web/modules/contrib/token/src/Controller/TokenCacheController.php
2018-11-23 12:29:20 +00:00

21 lines
421 B
PHP

<?php
namespace Drupal\token\Controller;
use Drupal\Core\Controller\ControllerBase;
/**
* Clears cache for tokens.
*/
class TokenCacheController extends ControllerBase {
/**
* Clear caches and redirect back to the frontpage.
*/
public function flush() {
token_clear_cache();
$this->messenger()->addMessage($this->t('Token registry caches cleared.'));
return $this->redirect('<front>');
}
}