美文网首页我爱编程
thinkphp5.0 $this->result报错 vari

thinkphp5.0 $this->result报错 vari

作者: 天天来啦啊 | 来源:发表于2018-05-25 10:18 被阅读0次

[0] InvalidArgumentException in Response.php line 316

variable type error: array

这话意思明白,就是你传入了一个数组,可这是啥意思?我不就是传数组让你转化给前端吗?我再看Response.php哦,原来72行指定路径了,再看核心文件夹指定的有json,jsonp,xml没有数组,哦,原来是缺第四个参数传入你想要的格式如:json

$data = ['aaa'];

$this->result($data,1,'信息','json');

$this->result不用return

相关文章

网友评论

    本文标题:thinkphp5.0 $this->result报错 vari

    本文链接:https://www.haomeiwen.com/subject/akjyjftx.html