刚下载的5.0版本$request->param()取不到值

浏览:4301 发布日期:2016/12/06 分类:ThinkPHP5专区
<?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
新手,看入门看到这里就卡住了
最佳答案
评论( 相关
后面还有条评论,点击查看>>