欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

Slim Get带参数404错误

程序员文章站 2022-05-10 23:11:38
...
接口实现:
$app->get('/hello/:name/', function ($name) {
    echo "Hello, $name";
});

get-url:http://localhost/prj/index.php/hello?name=myname
测试结果:404 Not Found

回复内容:

接口实现:

$app->get('/hello/:name/', function ($name) {
    echo "Hello, $name";
});

get-url:http://localhost/prj/index.php/hello?name=myname
测试结果:404 Not Found

路由直接http://localhost/prj/index.php/hello/myname就可以吧

相关标签: php