/** * Fetch setting * * @return string */ public function actionGetConfig() { $model = new DynaGridSettings(); $out = ['status' => '', 'content' => '']; if ($model->load(Yii::$app->request->post()) && $model->validate()) { $out = ['status' => 'success', 'content' => print_r($model->getDataConfig(), true)]; } echo Json::encode($out); }
/** * Fetch setting * * @return string */ public function actionGetConfig() { Yii::$app->response->format = Response::FORMAT_JSON; $model = new DynaGridSettings(); $out = ['status' => '', 'content' => '']; if ($model->load(Yii::$app->request->post()) && $model->validate()) { $out = ['status' => 'success', 'content' => print_r($model->getDataConfig(), true)]; } return $out; }