You are here

TokenCacheController.php in Token 8

File

src/Controller/TokenCacheController.php
View source
<?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>');
  }

}

Classes

Namesort descending Description
TokenCacheController Clears cache for tokens.