CI_Cache::save()

save($id, $data[, $ttl = 60[, $raw = FALSE]])

Parameters:
  • $id (string) – Cache item name
  • $data (mixed) – the data to save
  • $ttl (int) – Time To Live, in seconds (default 60)
  • $raw (bool) – Whether to store the raw value
Returns:

TRUE on success, FALSE on failure

Return type:

string

This method will save an item to the cache store. If saving fails, the method will return FALSE.

$this->cache->save('cache_item_id', 'data_to_cache');

Note

The $raw parameter is only utilized by APC and Memcache, in order to allow usage of increment() and decrement().

doc_CodeIgniter
2016-10-15 16:30:56
Comments
Leave a Comment

Please login to continue.