function TwigPhpStorageCache::__construct

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Template/TwigPhpStorageCache.php \Drupal\Core\Template\TwigPhpStorageCache::__construct()
  2. 8.9.x core/lib/Drupal/Core/Template/TwigPhpStorageCache.php \Drupal\Core\Template\TwigPhpStorageCache::__construct()
  3. 10 core/lib/Drupal/Core/Template/TwigPhpStorageCache.php \Drupal\Core\Template\TwigPhpStorageCache::__construct()

Store cache backend and other information internally.

Parameters

\Drupal\Core\Cache\CacheBackendInterface $cache: The cache bin.

string $twig_cache_prefix: A Twig cache file prefix that changes when Twig extensions change.

File

core/lib/Drupal/Core/Template/TwigPhpStorageCache.php, line 56

Class

TwigPhpStorageCache
Provides an alternate cache storage for Twig using PhpStorage.

Namespace

Drupal\Core\Template

Code

public function __construct(CacheBackendInterface $cache, $twig_cache_prefix) {
    $this->cache = $cache;
    $this->templateCacheFilenamePrefix = $twig_cache_prefix;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.