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這個路徑寫法?