PHPStorm和ThinkPHP 的使用

thinkPHP彻底开发手册:https://www.kancloud.cn/manual/thinkphp5/118003php

1、安装ThinkPHP框架 应用项目:https://github.com/top-think/think 核心框架:https://github.com/top-think/frameworkgit

2、PHPStorm打开项目github

一、访问项目入口 使用PHPStorm中的命令行工具启动Apache服务、设置端口thinkphp

$ cd public
$ php -S localhost:8080 router.php
复制代码

在浏览器中输入 localhost:8080 访问数组

二、定义路由 打开application中route.php文件 删除文件中原有的配置浏览器

use think\Route;

//Route::rule('路由表达式', '路由地址', '请求类型', '路与参数(数组)', '变量规则(数组)');
//Route::get('hello', 'sample/Test/hello');
Route::rule('hello', 'sample/Test/hello');
复制代码

开启强制路由配置 打开config.php文件,找到'url_route_must' => false,将false改成truebash

三、隐藏index.php config.php文件中添加如下代码app

'URL_CASE_INSENSITIVE'=>true,
//URL模式
'URL_MODEL'          => '2',
复制代码

3、ThinkPHP使用手册 https://www.kancloud.cn/manual/thinkphp5/118003框架

相关文章
相关标签/搜索