关于YII框架Response content must not be an array的解决方法

public function actionGet_permissions()
{
    Yii::$app->response->format = yiiwebResponse::FORMAT_JSON;
    return Auth_Item::find()->where(['owner_user_id' => NULL])->all();
}

就是在要输出的代码之前 加上

Yii::$app->response->format = yiiwebResponse::FORMAT_JSON;
原文地址:https://www.cnblogs.com/baker95935/p/10949141.html