Skip to main content
Version: Fegg 5.x

Cache::has

Check for a kept value

Description​

public static bool Cache::has( string $key )

Returns true when $key has a value that has not expired.

Arguments​

NameData typeDefaultRemarks
$keystringName of the value

Example​

Controller
use Fegg\Tool\Cache;

if (!Cache::has('ranking')) {
Cache::set('ranking', $this->_buildRanking(), 3600);
}