从tp3.2转到thinkphp5被tp5的返回的数据对象弄得焦头烂额.
打印request的信息
$request = thinkRequest::instance();
print_r($request);
返回的数据对象格式:
think\Request Object
(
[method:protected] => POST
[domain:protected] =>
[url:protected] =>
[baseUrl:protected] =>
[baseFile:protected] =>
[root:protected] =>
[pathinfo:protected] => index/index/delmulti.html
[path:protected] => index/index/delmulti
[routeInfo:protected] => Array
(
)
[env:protected] =>
[dispatch:protected] => Array
(
[type] => module
[module] => Array
(
[0] => index
[1] => index
[2] => delmulti
)
)
[module:protected] => index
[controller:protected] => Index
[action:protected] => delmulti
[langset:protected] => zh-cn
[param:protected] => Array
(
[id] => 1
)
[get:protected] => Array
(
)
[post:protected] => Array
(
[id] => 1
)
[request:protected] => Array
(
)
[route:protected] => Array
(
)
[put:protected] =>
[session:protected] => Array
(
)
[file:protected] => Array
(
)
[cookie:protected] => Array
(
)
[server:protected] => Array
(
)
[header:protected] => Array
(
[host] => localhost
[connection] => keep-alive
[content-length] => 4
[accept] => text/plain,
[__token__] => ff03c475943cb7db0a10c485000068b1
[x-requested-with] => XMLHttpRequest
[user-agent] => Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36
[origin] => http://localhost
[content-type] => application/x-www-form-urlencoded; charset=UTF-8
[referer] => http://localhost/NutCloud/demo/Frame/thinkphp5/public/
[accept-encoding] => gzip, deflate, br
[accept-language] => zh-CN,zh;q=0.9
[cookie] => thinkphp_show_page_trace=0|0; a3976_times=1; _ga=GA1.1.1623043278.1514942993; _gid=GA1.1.1822412755.1515375026; PHPSESSID=4q33f5j8i5i7s500g5lno8bd81
)
[mimeType:protected] => Array
(
[xml] => application/xml,text/xml,application/x-xml
[json] => application/json,text/x-json,application/jsonrequest,text/json
[js] => text/javascript,application/javascript,application/x-javascript
[css] => text/css
[rss] => application/rss+xml
[yaml] => application/x-yaml,text/yaml
[atom] => application/atom+xml
[pdf] => application/pdf
[text] => text/plain
[image] => image/png,image/jpg,image/jpeg,image/pjpeg,image/gif,image/webp,image/*
[csv] => text/csv
[html] => text/html,application/xhtml+xml,*/*
)
[content:protected] =>
[filter:protected] =>
[bind:protected] => Array
(
)
[input:protected] => id=1
[cache:protected] =>
[isCheckCache:protected] =>
)
我怎么获取[__token__]的值了?