当前位置:Gxlcms > PHP教程 > SlimGet带参数404错误

SlimGet带参数404错误

时间:2021-07-01 10:21:17 帮助过:31人阅读

接口实现:

$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就可以吧

人气教程排行