摘要:
基本用法 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)
摘要:
实例化请求对象 $request = Request::instance(); $request = request(); 获取请求信息 $request = Request::instance(); // 获取当前域名 echo 'domain: ' . $request->domain() . 阅读全文
posted @ 2021-10-30 14:47
胡勇健
阅读(126)
评论(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
胡勇健
阅读(91)
评论(0)
推荐(0)
摘要:
配置目录 系统默认的配置文件目录就是应用目录application下面 定义配置文件目录和应用目录同级 define('CONF_PATH', __DIR__.'/../config/'); 读取配置 echo \think\Config::get('default_return_type'); e 阅读全文
posted @ 2021-10-30 14:45
胡勇健
阅读(84)
评论(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
胡勇健
阅读(47)
评论(0)
推荐(0)

浙公网安备 33010602011771号