Cache
框架提供了程序运行生命周期
内的全局缓存,使用非常简单
// 只需要赋值就可以实现cache的设置了 - App::
$base ->cache ->testkey ='test' ;// 获取则是直接取元素,不存在则返回null $testKey = App::$base ->cache ->testkey ;
同时Cache也支持isset
判断及unset
操作
// isset 相当于先get 后isset 返回 true/false $bool =isset (App::$base ->cache ->testKey );// 删除缓存 unset (App::$base ->cache ->testKey );