You are here

public function RebuildCacheAccessController::rebuildCache in Rebuild Cache Access 8

Rebuild all caches, then redirects to the previous page.

1 string reference to 'RebuildCacheAccessController::rebuildCache'
rebuild_cache_access.routing.yml in ./rebuild_cache_access.routing.yml
rebuild_cache_access.routing.yml

File

src/Controller/RebuildCacheAccessController.php, line 54

Class

RebuildCacheAccessController
Returns responses for rebuild_cache_access module routes.

Namespace

Drupal\rebuild_cache_access\Controller

Code

public function rebuildCache() {
  drupal_flush_all_caches();
  $this
    ->messenger()
    ->addMessage($this
    ->t('All caches cleared.'));
  return new RedirectResponse($this
    ->reloadPage());
}