Skip to content

Kirby 5.0.4

$memCached->set()

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

$memCached->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 $memcached object it is applied to and returns it again.

Parent class

Kirby\Cache\MemCached

Examples

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