上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 36 下一页
摘要: 实例化请求对象 $request = Request::instance(); $request = request(); 获取请求信息 $request = Request::instance(); // 获取当前域名 echo 'domain: ' . $request->domain() . 阅读全文
posted @ 2021-10-30 14:47 胡勇健 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 路由开关模式 普通模式 'url_route_on' => false, 混合模式 'url_route_on' => true, 'url_route_must'=> false, 强制模式 'url_route_on' => true, 'url_route_must' => true, 路由定 阅读全文
posted @ 2021-10-30 14:46 胡勇健 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 配置目录 系统默认的配置文件目录就是应用目录application下面 定义配置文件目录和应用目录同级 define('CONF_PATH', __DIR__.'/../config/'); 读取配置 echo \think\Config::get('default_return_type'); e 阅读全文
posted @ 2021-10-30 14:45 胡勇健 阅读(68) 评论(0) 推荐(0) 编辑
摘要: composer方式下载源码 composer create-project topthink/think=5.0.* tp5 --prefer-dist nginx配置(默认不支持path_info模式,要使用?s=/的方式访问地址) server { listen 80; server_name 阅读全文
posted @ 2021-10-30 14:44 胡勇健 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 启动服务器 php think run 查看版本 php think version 生成控制器 php think make:controller User 生成模型 php think make:model User 生成中间件 php think make:middleware Auth 生成 阅读全文
posted @ 2021-10-18 17:32 胡勇健 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 用法 配置文件 config/filesystem.php <?php return [ // 默认磁盘 'default' => env('filesystem.driver', 'local'), // 磁盘列表 'disks' => [ 'local' => [ 'type' => 'loca 阅读全文
posted @ 2021-10-18 17:21 胡勇健 阅读(1421) 评论(0) 推荐(0) 编辑
摘要: 用法 cookie配置文件 config/cookie.php <?php // + // | Cookie设置 // + return [ // cookie 保存时间 'expire' => 0, // cookie 保存路径 'path' => '/', // cookie 有效域名 'dom 阅读全文
posted @ 2021-10-18 17:01 胡勇健 阅读(368) 评论(0) 推荐(0) 编辑
摘要: 开启session app\middleware.php <?php // 全局中间件定义文件 return [ // 全局请求缓存 // \think\middleware\CheckRequestCache::class, // 多语言加载 // \think\middleware\LoadLa 阅读全文
posted @ 2021-10-18 16:43 胡勇健 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 缓存配置 <?php // + // | 缓存设置 // + return [ // 默认缓存驱动 'default' => env('cache.driver', 'file'), // 缓存连接方式配置 'stores' => [ 'file' => [ // 驱动方式 'type' => 'F 阅读全文
posted @ 2021-10-18 16:29 胡勇健 阅读(485) 评论(0) 推荐(0) 编辑
摘要: 验证器使用 命令行生成User验证器 php think make:validate User 验证器添加规则 app\validate\User.php <?php declare (strict_types = 1); namespace app\validate; use think\Vali 阅读全文
posted @ 2021-10-18 16:14 胡勇健 阅读(281) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 36 下一页