上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 36 下一页
摘要: cookie配置 config.php 'cookie' => [ // cookie 名称前缀 'prefix' => '', // cookie 保存时间 'expire' => 0, // cookie 保存路径 'path' => '/', // cookie 有效域名 'domain' = 阅读全文
posted @ 2021-10-31 15:52 胡勇健 阅读(286) 评论(0) 推荐(0)
摘要: session配置 config.php file配置 'session' => [ 'id' => '', // SESSION_ID的提交变量,解决flash上传跨域 'var_session_id' => '', // SESSION 前缀 'prefix' => 'think', // 驱动 阅读全文
posted @ 2021-10-31 15:51 胡勇健 阅读(293) 评论(0) 推荐(0)
摘要: 缓存独立配置文件 extra/cache.php <?php return [ // 驱动方式,type为complex时为混合类型 'type' => 'complex', // 默认使用的缓存 'default' => [ // 驱动方式 'type' => 'file', 'prefix' = 阅读全文
posted @ 2021-10-31 15:10 胡勇健 阅读(251) 评论(0) 推荐(0)
摘要: 独立验证 <?php namespace app\index\controller; use think\Controller; use think\Validate; class Index extends Controller { public function index() { $valid 阅读全文
posted @ 2021-10-31 14:20 胡勇健 阅读(127) 评论(0) 推荐(0)
摘要: 开启调试模式 .env app_debug = true 开启Trace调试 'app_trace' => true, 异常捕捉 try{ $user = Db::table('user')->where('id',6)->find(); var_dump($user); }catch(\Excep 阅读全文
posted @ 2021-10-31 13:44 胡勇健 阅读(280) 评论(0) 推荐(0)
摘要: 日志配置文件 config.php 'log' => [ // 日志记录方式,内置 file socket 支持扩展 'type' => 'File', // 日志保存目录 'path' => LOG_PATH, // 日志记录级别 'level' => [], //自动清理 'max_files' 阅读全文
posted @ 2021-10-31 00:31 胡勇健 阅读(235) 评论(0) 推荐(0)
摘要: 基本用法 index控制器 controller/Index.php <?php namespace app\index\controller; use think\Controller; class Index extends Controller { public function index( 阅读全文
posted @ 2021-10-30 18:07 胡勇健 阅读(69) 评论(0) 推荐(0)
摘要: 基本用法 命令行生成User模型 php think make:model index/User 模型调用 $user = new \app\index\model\User(); $user = $user->where('id',3)->find(); var_dump($user->toArr 阅读全文
posted @ 2021-10-30 17:50 胡勇健 阅读(173) 评论(0) 推荐(0)
摘要: 命令行生成控制器 php think make:controller index/User 渲染模板 use think\View; $view = new View(); $view->assign('name','huyongjian'); return $view->fetch('index' 阅读全文
posted @ 2021-10-30 14:49 胡勇健 阅读(30) 评论(0) 推荐(0)
摘要: 基本使用 mysql生成数据库 create database tp5; use tp5; mysql生成数据表 create table user( id int unsigned NOT NULL AUTO_INCREMENT, name varchar(100), status tinyint 阅读全文
posted @ 2021-10-30 14:49 胡勇健 阅读(122) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 36 下一页