TP5路由的位置导致错误
// 测试 '[js]' => [ ':id' => ['test/test/js', ['method' => 'get'], ['id' => '\d+']], ':id/info' => ['test/test/info', ['method' => 'get'], ['id' => '\d+']], ],
这一行的路由规则':id' => ['test/test/js', ['method' => 'get'], ['id' => '\d+']] 会屏蔽下一行的规则,导致下一行的路由永远不生效
比如: www.test.com/54 正常生效
www.test.com/54/info 没生效,和www.test.com/54效果是一样的
可以换个位置即可
// 测试 '[js]' => [ ':id/info' => ['test/test/info', ['method' => 'get'], ['id' => '\d+']], ':id' => ['test/test/js', ['method' => 'get'], ['id' => '\d+']], ],
路由是一行一行匹配的