pinguo / php-msf-demo

GNU General Public License v2.0
72 stars 41 forks source link

RESTful的配置不生效 #36

Open moyee opened 6 years ago

moyee commented 6 years ago

按开发文档,可以进行路由映射配置,但不知道应该怎么样配置?

如下配置在config/params.php 或者 config/docker/params.php 直接访问/users/ask 依然回提示找不到方法

$config['rest']['route']['rules'] = [ 'GET,POST /groups' => '/account/profile', 'GET /users/ask' => 'user/apply', 'GET /users' => 'user/index', 'GET /users/<uid:\d+>' => 'user/view', 'PUT /users/<method:\w+>' => 'user/', 'DELETE /users/<uid:\d+>' => 'user/delete', ]

viaweb3 commented 6 years ago

需要配置路由为 rest 路由。https://github.com/pinguo/php-msf-docs/blob/master/chapter-5/5.9-RESTful.md#使用方式