Advertisement
vanchelo

cacheManager

Sep 6th, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. $param = 'param1_value';
  2. $inCache = false;
  3. if (!$p = $modx->cacheManager->get('param1',array(xPDO::OPT_CACHE_KEY => 'minishop/goods_params'))) {
  4.     $inCache = false;
  5. } else {
  6.     $inCache = true;
  7.     echo 'В кэше';
  8. }
  9.  
  10. if (!$inCache) {
  11.     $modx->cacheManager->set('param1',$param,0,array(xPDO::OPT_CACHE_KEY => 'minishop/goods_params'));
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement