Skip to content

Kirby 5.0.4

$fileCache->getOrSet()

Returns a value by either getting it from the cache or via the callback function which then is stored in the cache for future retrieval. This method cannot be used for null as value to be cached.

$fileCache->getOrSet(string $key, Closure $result, int $minutes = 0)

Parameters

Name Type Default
$keyrequired string no default value
$resultrequired Closure no default value
$minutes int 0

Parent class

Kirby\Cache\FileCache inherited from Kirby\Cache\Cache