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框架