thinkphp清除緩存


前台
 1 //清除緩存
 2 $(function(){
 3     $("#cache").click(function(){
 4         layer.confirm('你確定要清除緩存嗎?', {icon: 3, title:'提示'}, function(index){                   
 5             $.getJSON("{:U('Sys/clearRuntime')}",function(data){
 6                 if(data.status == 1){
 7                     layer.msg(data.info,{icon:1});
 8                     
 9                 }else{
10                     layer.msg(data.info,{icon:4});
11                 }
12         
13             });
14             layer.close(index);
15         })
16     });      
17 });
后台
1 //刪除緩存
2 public function clearRuntime() 
3 {          
4     delFileByDir(APP_PATH.'Runtime/'); 
5     $this->success('刪除緩存成功!');
6 }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM