首先引用缓存文件 use think\Cache; ...
use think cache public function index Cache::get name 获取缓存,如果name值不存在则返回false if Cache::get name echo lt script gt alert 旧缓存 lt script gt else new new indexModel name new gt lst Cache::set name , name ...
2019-01-25 15:34 0 3226 推荐指数:
首先引用缓存文件 use think\Cache; ...
一、文件 1、缓存配置文件:thinkphp\convention.php 2、缓存文件:thinkphp\library\think\Cache.php 3、驱动目录:thinkphp\library\think\cache\driver,包含8个文件 ...
在application\config.php里加 //以下为静态缓存配置 'app_debug' => false,//false为开启静态缓存模式 'html_cache_on' => true, // 开启静态缓存 'html_cache_time' => 7200 ...
// 方法1 insertGetId方法新增数据并返回主键值使用getLastInsID方法: Db::name('user')->insert($data); $userId = Db::name('user')->getLastInsID(); // 方法2 使用 ...
ThinkPHP数据库处理: 1.MySQL的数据库连接 首先配置database.php文件 使用{dump(config('database));}来查看数据库的配置项 使用 {$res = Db::connect(); dump($res);}来查看数据库的连接信息 我们可以在{Db ...
个人记录一下哈 ...
当参数为数组的时候 Data是模型里面类的名字,是模型文件的名字,也是表的名字 public function test() { //$res = $thi ...
Thinkphp5.0 的使用模型Model更新数据 (1)使用update()方法进行更新数据 一、where条件写在更新数据中 (这种情况更新的数据,必须含主键) 二、where条件使用update()的第二个参数,传递数组 ...