thinkphp缓存的简单使用

    	$cache=S('newskey');

    	if(!$cache){

    		$cache=M('news')->cache(true,60,'newskey')->where('state=1')->order('publishtime desc')->limit(5)->select();

    	}

    	$this->assign('recentnews',$cache);

  

 

你可能感兴趣的:(thinkphp)