<?php
namespace app\index\controller;
use think\Request;
class Index
{
public function hello(Request $request)
{
echo '请求参数:';
dump($request->param());
echo 'name:'.$request->param('name');
}
}用这种方式取不到值http://192.168.0.102/index/index/hello.html?name=thinkphp&home=house但是pathinfo的话就可以(http://192.168.0.102/index/index/hello/name/hinkphp/home/house),这是咋回事?
==================================
输出这个:
请求参数:
array(1) {
["index/index/hello_html"] => string(0) ""
}
name:用pathinfo形式的网址就输出这个:请求参数:
array(3) {
["index/index/hello/name/thinkphp/home/house"] => string(0) ""
["name"] => string(8) "thinkphp"
["home"] => string(5) "house"
}
name:thinkphp新手,看入门看到这里就卡住了 最佳答案