create:
代码语言:javascript复制<?php
namespace appindexcontroller;
use appBaseController;
use thinkfacadeDb;
use appmodelAaa;
use thinkfacadeCache;
class Index extends BaseController
{
public function hello()
{
//设置缓存
Cache::set("bj","您好",3600);
//获取缓存
$res=Cache::get("bj");
//输出缓存
halt($res);
}
}
delete:
代码语言:javascript复制<?php
namespace appindexcontroller;
use appBaseController;
use thinkfacadeDb;
use appmodelAaa;
use thinkfacadeCache;
class Index extends BaseController
{
public function hello()
{
//设置缓存
Cache::set("bj","您好",3600);
//删除缓存
Cache::delete('bj');
//获取缓存
$res=Cache::get("bj");
//输出缓存
halt($res);
}
}