public function TwigPhpStorageCache::write

public TwigPhpStorageCache::write($key, $content)

Writes the compiled template to cache.

Parameters

string $key The cache key:

string $content The template representation as a PHP class:

Overrides Twig_CacheInterface::write

File

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

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);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Template!TwigPhpStorageCache.php/function/TwigPhpStorageCache::write/8.1.x