This repository has been archived on 2025-09-29. 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

22 lines
421 B
PHP
Raw Normal View History

2017-05-22 15:12:47 +01:00
<?php
namespace Drupal\token\Controller;
use Drupal\Core\Controller\ControllerBase;
/**
* Clears cache for tokens.
*/
2018-11-23 12:29:20 +00:00
class TokenCacheController extends ControllerBase {
2017-05-22 15:12:47 +01:00
/**
* Clear caches and redirect back to the frontpage.
*/
public function flush() {
token_clear_cache();
2018-11-23 12:29:20 +00:00
$this->messenger()->addMessage($this->t('Token registry caches cleared.'));
2017-05-22 15:12:47 +01:00
return $this->redirect('<front>');
}
}