improving cache API documentation.
This commit is contained in:
parent
f72171f691
commit
83ab60922b
|
@ -47,6 +47,22 @@ public static function driver($driver = null)
|
||||||
/**
|
/**
|
||||||
* Get an item from the cache.
|
* Get an item from the cache.
|
||||||
*
|
*
|
||||||
|
* If the cached item doesn't exist, the specified default value will be returned.
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* // Get the "name" item from the cache
|
||||||
|
* $name = Cache::get('name');
|
||||||
|
*
|
||||||
|
* // Get the "name" item, but return "Fred" if it doesn't exist
|
||||||
|
* $name = Cache::get('name', 'Fred');
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* The driver may also be specified:
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* $name = Cache::get('name', null, 'memcached');
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param mixed $default
|
* @param mixed $default
|
||||||
* @param string $driver
|
* @param string $driver
|
||||||
|
@ -66,6 +82,14 @@ public static function get($key, $default = null, $driver = null)
|
||||||
* Get an item from the cache. If the item doesn't exist in the cache, store
|
* Get an item from the cache. If the item doesn't exist in the cache, store
|
||||||
* the default value in the cache and return it.
|
* the default value in the cache and return it.
|
||||||
*
|
*
|
||||||
|
* <code>
|
||||||
|
* // Get the name item. If it doesn't exist, store "Fred" for 30 minutes
|
||||||
|
* $name = Cache::remember('name', 'Fred', 30);
|
||||||
|
*
|
||||||
|
* // Closures may also be used as default values
|
||||||
|
* $name = Cache::remember('votes', function() {return Vote::count();}, 30);
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param mixed $default
|
* @param mixed $default
|
||||||
* @param int $minutes
|
* @param int $minutes
|
||||||
|
|
Loading…
Reference in New Issue