Skip to content

Kirby 5.0.4

$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

This method modifies the existing $filecache object it is applied to and returns it again.

Parent class

Kirby\Cache\FileCache

Examples

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