为了账号安全,请及时绑定邮箱和手机立即绑定

thinkPHP5路由

thinkPHP5路由

PHP
大写的王 2017-12-26 12:44:54
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/thinkphphttp://localhost/tp5/public/news/6001
查看完整描述

1 回答

?
蛋肠加辣不要葱

TA贡献43条经验 获得超9个赞

use think\Route;

Route::get('路由规则', '模块名/方法名');
Route::post('路由规则', '模块名/方法名');
//eg:
Route::post('user/add', 'api/user/adduser');


查看完整回答
反对 回复 2017-12-26
  • 1 回答
  • 0 关注
  • 1743 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号