Skip to content

Kirby 5.0.2

$fileCache->set()

Writes an item to the cache for a given number of minutes and returns whether the operation was successful

$fileCache->set(string $key, $value, int $minutes = 0): bool

Parameters

Name Type Default
$keyrequired string no default value
$valuerequired mixed no default value
$minutes int 0

Return type

bool

Parent class

Kirby\Cache\FileCache

Examples

// put an item in the cache for 15 minutes
$cache->set('value', 'my value', 15);