think\Request 下无法获取 module等信息

浏览:1806 发布日期:2017/02/24
5.0.0 - 严重 - 已关闭
路由配置return [
    /*
    * 首页
    */
    '/' => ['index/index/index', ['method' => 'get']],
    
    /*
    * 后台
    */
    '[admin]'     => [
        // 登录
        'signin' => ['admin/signin/index', ['method' => 'get', 'after_behavior' => '\app\admin\behavior\Group']],
        // 登录提交
        'signin/post' => ['admin/signin/postIndex', ['method' => 'post', 'after_behavior' => '\app\admin\behavior\Group']],
        // 退出
        'signout' => ['admin/signin/signout', ['method' => 'get', 'after_behavior' => '\app\admin\behavior\Group']],
        // 后台首页
        'dashboard' => ['admin/index/index', ['method' => 'get', 'after_behavior' => '\app\admin\behavior\Group']],
        'welcome' => ['admin/index/welcome', ['method' => 'get', 'after_behavior' => '\app\admin\behavior\Group']],
    ],

];
打印Request 地址: http:\\xx.com/admin/welcome.htmlobject(think\Request)#2 (32) {
  ["method":protected] => string(3) "GET"
  ["domain":protected] => NULL
  ["url":protected] => NULL
  ["baseUrl":protected] => NULL
  ["baseFile":protected] => NULL
  ["root":protected] => NULL
  ["pathinfo":protected] => string(18) "admin/welcome.html"
  ["path":protected] => string(13) "admin/welcome"
  ["routeInfo":protected] => array(4) {
    ["rule"] => array(2) {
      [0] => string(5) "admin"
      [1] => string(7) "welcome"
    }
    ["route"] => string(19) "admin/index/welcome"
    ["option"] => array(2) {
      ["method"] => string(3) "get"
      ["after_behavior"] => string(25) "\app\admin\behavior\Group"
    }
    ["var"] => array(0) {
    }
  }
  ["dispatch":protected] => array(0) {
  }
  ["module":protected] => NULL
  ["controller":protected] => NULL
  ["action":protected] => NULL
  ["langset":protected] => string(5) "zh-cn"
  ["param":protected] => array(0) {
  }
  ["get":protected] => array(0) {
  }
  ["post":protected] => array(0) {
  }
  ["request":protected] => array(0) {
  }
  ["route":protected] => array(0) {
  }
  ["put":protected] => NULL
  ["session":protected] => array(0) {
  }
  ["file":protected] => array(0) {
  }
  ["cookie":protected] => array(0) {
  }
  ["server":protected] => array(0) {
  }
  ["header":protected] => array(0) {
  }
  ["mimeType":protected] => array(14) {
    ["xml"] => string(42) "application/xml,text/xml,application/x-xml"
    ["json"] => string(62) "application/json,text/x-json,application/jsonrequest,text/json"
    ["js"] => string(63) "text/javascript,application/javascript,application/x-javascript"
    ["css"] => string(8) "text/css"
    ["rss"] => string(19) "application/rss+xml"
    ["yaml"] => string(28) "application/x-yaml,text/yaml"
    ["atom"] => string(20) "application/atom+xml"
    ["pdf"] => string(15) "application/pdf"
    ["text"] => string(10) "text/plain"
    ["png"] => string(9) "image/png"
    ["jpg"] => string(32) "image/jpg,image/jpeg,image/pjpeg"
    ["gif"] => string(9) "image/gif"
    ["csv"] => string(8) "text/csv"
    ["html"] => string(35) "text/html,application/xhtml+xml,*/*"
  }
  ["content":protected] => NULL
  ["filter":protected] => string(0) ""
  ["bind":protected] => array(0) {
  }
  ["input":protected] => string(0) ""
  ["cache":protected] => NULL
  ["isCheckCache":protected] => NULL
}
错误点 ,无法获取 以下三个参数
["module":protected] => NULL
["controller":protected] => NULL
["action":protected] => NULL
评论(
后面还有条评论,点击查看>>