thinkphp6.0共9篇

thinkphp6 App类的使用

thinkphp6 App类的使用-趙哥博客-赵哥博客
dump($this->app->getThinkPath());//获取核心框架目录 dump($this->app->getRootPath());//获取应用根目录 dump($this->app->getBasePath());//获取应用基础目录 dump($this...
趙哥的头像-趙哥博客-赵哥博客趙哥2年前
016612

thinkphp6 Filesystem文件系统类的使用

thinkphp6 Filesystem文件系统类的使用-趙哥博客-赵哥博客
config/filesystem.php配置文件中配置上传根目录及上传规则,例如: return [ 'default' => 'local', 'disks' => [ 'local' => [ 'type' => 'local', 'root' => app()->getRu...
趙哥的头像-趙哥博客-赵哥博客趙哥2年前
019636

thinkphp6 数据库和模型代码智能提示

thinkphp6 数据库和模型代码智能提示-趙哥博客-赵哥博客
前言: 自thinkphp5.1之后,ThinkPHP6 Db和模型方法提示消失,如何修复?让我们来看看如何修复提高我们开发效率。 DB数据库提示修复: 代码替换位置:第23行以下注释内容 代码: /** * Class Db...
趙哥的头像-趙哥博客-赵哥博客趙哥2年前
034213

thinkphp6.0 多语言

thinkphp6.0 多语言-趙哥博客-赵哥博客
1.如果要开启多语言切换功能,中间件定义文件 middleware.php 开启; // 多语言加载 \think\middleware\LoadLangPack::class, 2. 配置文件在 config/lang.php 文件,默认设置的是 zh-cn 中文语...
趙哥的头像-趙哥博客-赵哥博客趙哥2年前
06087

thinkphp6.0 上传功能

thinkphp6.0 上传功能-趙哥博客-赵哥博客
如果要实现上传功能,首先需要建立一个上传表单,具体如下:<form action='http://localhost/tp6/public/upload' enctype='multipart/form-data' method='post'> <input type='file' n...
趙哥的头像-趙哥博客-赵哥博客趙哥2年前
079913

thinkphp6.0 缓存功能

thinkphp6.0 缓存功能-趙哥博客-赵哥博客
系统内置了很多类型的缓存,除了 File,其它均需要结合相关产品; 我们这里主要演示 File 文本缓存,其它的需要学习相关产品; 配置文件 cache.php 进行缓存配置,默认生成在 runtime/cache 目...
趙哥的头像-趙哥博客-赵哥博客趙哥2年前
07207

thinkphp6.0 cookie

thinkphp6.0 cookie-趙哥博客-赵哥博客
Cookie 是客户端存储,默认情况下是开启初始化的,在 config/cookie.php: ::set()方法,创建一个最基本的 cookie,可以设置前缀、过期时间、数组等; Cookie::set('user', 'Mr.Lee'); //临时保...
趙哥的头像-趙哥博客-赵哥博客趙哥2年前
052215

thinkphp6.0 Session

thinkphp6.0 Session-趙哥博客-赵哥博客
Session 是服务端存储,在使用 Session 之前,需要开启初始化,在中间件文件 middleware.php; // Session 初始化 \think\middleware\SessionInit::class TP6.0 不支持原生$_SESSION 的获取方式...
趙哥的头像-趙哥博客-赵哥博客趙哥2年前
040810

ThinkPHP6目录结构+安装教程

ThinkPHP6目录结构+安装教程-趙哥博客-赵哥博客
安装 运行环境要求PHP7.2+,兼容PHP8.1 composer create-project topthink/think tp 6.0.* 如果需要更新框架使用 composer update topthink/framework 主要新特性 采用PHP7强类型(严格模式)支...
趙哥的头像-趙哥博客-赵哥博客趙哥2年前
03868