随心的博客

好记性不如个烂笔头,随心记录!

返回顶部
摘要: TP6中缓存的使用 使用缓存,需引入 cache类 use think\facade\Cache; 缓存配置:config/cache.php return [ 'default' => 'file', 'stores' => [ // 文件缓存 'file' => [ // 驱动方式 'type' 阅读全文
posted @ 2021-11-05 15:32 yangphp 阅读(2827) 评论(0) 推荐(0) 编辑
摘要: TP6中命令行操作 1、启动内置服务器 php think run //指定IP和端口 php think run -H tp.com -p 80 2、查看当前版本 php think version 3、快速生成应用 php think build demo 4、快速生成控制器 //生成index 阅读全文
posted @ 2021-11-05 15:30 yangphp 阅读(951) 评论(0) 推荐(0) 编辑
摘要: TP6中请求的使用 一、请求的使用 //1、引入Request对象 use think\facade\Request; //方式1、构造方法注入 protected $request; public function __construct(Request $request) { $this->re 阅读全文
posted @ 2021-11-05 13:22 yangphp 阅读(1844) 评论(0) 推荐(0) 编辑
摘要: TP6模型操作 数据库的所有查询构造器方法模型中都可以支持,可以定义自己的方法, 所以也可以把模型看成是数据库的增强版 一、模型的定义 <?php namespace app\model; use think\Model; class UserModel extends Model { protec 阅读全文
posted @ 2021-11-05 13:13 yangphp 阅读(1514) 评论(0) 推荐(0) 编辑