Thinkphp5.0 的响应方式
$res = config('default_return_type'
);
dump($res);
//默认是html
//修改为json
\think\Config::set('default_return_type','json'
);
$res = config('default_return_type'
);
dump($res);
//json
$data = ['code'=>200,'result'=>['id'=>1,'name'=>'aa'
]];
return $data;
转载于:https://www.cnblogs.com/gyfluck/p/9407615.html
相关资源:Thinkphp5.0 框架的请求方式与响应方式分析