\Twig_CacheInterface

Interface implemented by cache classes.

It is highly recommended to always store templates on the filesystem to benefit from the PHP opcode cache. This interface is mostly useful if you need to implement a custom strategy for storing templates on the filesystem.

Summary

Methods
Constants
generateKey()
write()
load()
getTimestamp()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

generateKey()

generateKey(string  $name, string  $className) : string

Generates a cache key for the given template class name.

Parameters

string $name

The template name

string $className

The template class name

Returns

string

write()

write(string  $key, string  $content) 

Writes the compiled template to cache.

Parameters

string $key

The cache key

string $content

The template representation as a PHP class

load()

load(string  $key) 

Loads a template from the cache.

Parameters

string $key

The cache key

getTimestamp()

getTimestamp(string  $key) : integer

Returns the modification timestamp of a key.

Parameters

string $key

The cache key

Returns

integer