安装tp6.0框架
composer create-project topthink/think=6.0.x-dev tp
视图下载
composer require topthink/think-view
图像处理(TP5.0,TP6.0适应)
composer require topthink/think-image
多应用模式下载
composer require topthink/think-multi-app
快速生成应用
php think build admin
快速生成控制器
php think make:controller admin@Blog
快速生成模型
php think make:model admin@BlogModel
创建验证器类
php think make:validate admin@AdminCheck
快速生成中间件
php think make:middleware admin@Check
验证码下载
composer require topthink/think-captcha
如果需要使用验证码,则需要开启session(全局中间件开启)
验证码引用
<div>{:captcha_img()}</div>
验证:captcha
路由配置
隐藏入口文件public/.htaccess
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>
开启debug调试模式:(复制粘贴)
trace调试:(默认开启)(如果没有则重新安装tp6.0框架)
//开启应用trace调试
'app_trace' => true,
配置数据库(这里是多应用模式下的数据库配置,也可以在.env中配置全局的数据库)
文件上传保存路径配置
二级域名的绑定
(内容比较简陋,后期会进行补充)