public function actionList() { $params = Yii::$app->request->queryParams; $limit = $params["iDisplayLength"]; $offset = $params["iDisplayStart"]; $sEcho = $params["sEcho"]; $query = Community::find(); $count = $query->count(); $aaData = $query->asArray()->orderBy(['community_id' => SORT_DESC])->limit($limit)->offset($offset)->all(); \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; return ['success' => true, 'aaData' => $aaData, "iTotalRecords" => $count, "iTotalDisplayRecords" => $count, "sEcho" => $sEcho]; }