[ 'class' => LoginBehavior::className(), ], ]); } public function actionConfig() { $model = SmsSetting::findOne([ 'cx_mch_id' => $this->cx_mch_id, ]); if($model == null){ $model = new SmsSetting(); } if(\Yii::$app->request->isPost){ $form = new SmsConfigEditForm(); $form->attributes = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $form->model = $model; $data = $form->save(); return $this->responseHandler($data); } $return_url = ""; $type = $model->isNewRecord ? SmsSetting::TYPE_ALIYUN : $model->type; return $this->render('config',[ 'return_url' => $return_url, 'model' => $model, 'tpl_list' => SmsTpl::getTplList($type, $this->cx_mch_id), ]); } }