1.问题:照着tp5快速入门手册里学习,运行一段代码和书中的结果(资源类型)不同
2.相关代码:
public function hello(Request $request){
echo '请求参数';
dump(input());
echo 'name:' .$request->param('name');
echo '资源类型:' .$request->type(). '
';
}
访问路径为:
tp5.com/index/index/hello/test/ddd.html?name=think
书中的结果:资源类型:html,
我运行的结果是:资源类型:xml,
问题出在哪???
还有一个问题,如果把访问路径改成tp5.com/index/index/hello/test/ddd.html/name/think
请求参数结果也变了,
原来路径访问结果:
array(2) {
["name"] => string(5) "think"
["test"] => string(3) "ddd"
}
后来的路径结果:
array(2) {
["test"] => string(8) "ddd.html"
["name"] => string(5) "think"
}
怎么理解tp5.com/index/index/hello/test/ddd.html?name=think这个路径写法?