function TwigPhpStorageCache::storage

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

Gets the PHP code storage object to use for the compiled Twig files.

Return value

\Drupal\Component\PhpStorage\PhpStorageInterface

File

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

Class

TwigPhpStorageCache
Provides an alternate cache storage for Twig using PhpStorage.

Namespace

Drupal\Core\Template

Code

protected function storage() {
    if (!isset($this->storage)) {
        $this->storage = PhpStorageFactory::get('twig');
    }
    return $this->storage;
}

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