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
| Name | Data type | Default | Remarks |
|---|---|---|---|
| $key | string | Name of the value |
Example
Controller
use Fegg\Tool\Cache;
if (!Cache::has('ranking')) {
Cache::set('ranking', $this->_buildRanking(), 3600);
}