php - tp5 get request parameters
女神的闺蜜爱上我
女神的闺蜜爱上我 2017-06-20 10:07:39
0
2
736

1. Problem: Following the tp5 quick start manual, running a piece of code and the result (resource type) in the book are different
2. Related code:

public function hello(Request $request){
        echo '请求参数';
        dump(input());
        echo 'name:' .$request->param('name');
        echo '资源类型:' .$request->type(). '<br/>';
}

The access path is:
tp5.com/index/index/hello/test/ddd.html?name=think
The results in the book: Resource type: html,
The result of my operation is : Resource type: xml,
What is the problem? ? ?

There is another problem. If you change the access path to tp5.com/index/index/hello/test/ddd.html/name/think
The request parameter results will also change.
The original path access results :
array(2) {
["name"] => string(5) "think"
["test"] => string(3) "ddd"
}
Later path results:
array(2) {
["test"] => string(8) "ddd.html"
["name"] => string(5) "think"
}
How do you understand the path writing of tp5.com/index/index/hello/test/ddd.html?name=think?

女神的闺蜜爱上我
女神的闺蜜爱上我

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!