Home >Backend Development >PHP Tutorial >Slim Get带参数404错误

Slim Get带参数404错误

不言
不言Original
2018-05-18 16:37:341037browse


接口实现:

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn