YII 报错:
Response content must not be an array
yii 在 Controller 中返回数据,要加返回数据前加下面代码:
Yii::$app->response->format = Response::FORMAT_JSON;
返回的数据为 return array(),举个栗子:
return [ 'id' => $id, 'remark' => $remark, ];
YII 报错:
Response content must not be an array
yii 在 Controller 中返回数据,要加返回数据前加下面代码:
Yii::$app->response->format = Response::FORMAT_JSON;
返回的数据为 return array(),举个栗子:
return [ 'id' => $id, 'remark' => $remark, ];