Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Environment.php

function Environment::removeCache

File

vendor/twig/twig/src/Environment.php, line 238

Class

Environment
Stores the Twig configuration and renders templates.

Namespace

Twig

Code

public function removeCache(string $name) : void {
    $cls = $this->getTemplateClass($name);
    $this->hotCache[$name] = $cls . '_' . bin2hex(random_bytes(16));
    if ($this->cache instanceof RemovableCacheInterface) {
        $this->cache
            ->remove($name, $cls);
    }
    else {
        throw new \LogicException(\sprintf('The "%s" cache class does not support removing template cache as it does not implement the "RemovableCacheInterface" interface.', \get_class($this->cache)));
    }
}
RSS feed
Powered by Drupal