function TwigPhpStorageCache::write

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

File

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

Class

TwigPhpStorageCache
Provides an alternate cache storage for Twig using PhpStorage.

Namespace

Drupal\Core\Template

Code

public function write($key, $content) {
    $this->storage()
        ->save($key, $content);
    // Save the last mtime.
    $cid = 'twig:' . $key;
    $this->cache
        ->set($cid, REQUEST_TIME);
}

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