thinkPHP5路由

return [
//  '__pattern__' => [
//      'name' => '\w+',
//  ],
//  '[hello]'     => [
//      ':id'   => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
//      ':name' => ['index/hello', ['method' => 'post']],
//  ],
    'news/:id'   => ['admin/index/info'],
    'hello/:name' => ['index/index/hello'],
];


在app应用目录下有个route.php 路由这样配置的 但是访问提示页面错误 请问是哪里的问题

tp5是项目目录

http://localhost/tp5/public/hello/name/thinkphp

http://localhost/tp5/public/news/6001

大写的王
浏览 1631回答 1
1回答

蛋肠加辣不要葱

use think\Route; Route::get('路由规则', '模块名/方法名'); Route::post('路由规则', '模块名/方法名'); //eg: Route::post('user/add', 'api/user/adduser');
打开App,查看更多内容
随时随地看视频慕课网APP