Advertisement
kotvalera83

Codeigniter cache

Oct 10th, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1. $cacheID = 'assignments_calendar_'.$id;
  2. if (!$assignments = $ci->cache->get($cacheID)){
  3.     $assignments = $ci->model->get_calendar_assignments($id);
  4.     $ci->cache->save($cacheID, $assignments, 60*60*24);
  5. }
  6.  
  7. if ($this->cache->get('assignments_calendar_'.$id)) {
  8.     $this->cache->delete('assignments_calendar_'.$id);
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement