*/ class SettingController extends BaseController { /** * @return mixed|string * @throws \yii\web\NotFoundHttpException */ public function actionSpecialMessage() { if (Yii::$app->request->isPost) { try { Yii::$app->services->addonsConfig->setConfig([ 'special' => Yii::$app->request->post('setting') ]); return $this->message('修改成功', $this->redirect(['special-message'])); } catch (\Exception $e) { return $this->message($e->getMessage(), $this->redirect(['special-message']), 'error'); } } return $this->render('special-message', [ 'list' => Yii::$app->wechatService->config->specialConfig(), ]); } }