예제 #1
0
 /**
  * Lists all State models.
  * @return mixed
  */
 public function actionIndex()
 {
     $model = new SettingsForm();
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         $model->saveSettings();
         Yii::$app->session->setFlash('success', __('Your changes have been saved successfully.'));
         return $this->redirect(['index']);
     } else {
         return $this->render('index', ['model' => $model]);
     }
 }