public function actionAdd() { $model = new AddCodeForm(); if ($model->load(Yii::$app->request->post()) && $model->add()) { AlertHelper::appendAlert('success', Yii::t('happycode', 'Your paste was successfully added and is currently waiting for administrator to approve it.')); return $this->redirect(['site/index']); } else { return $this->render('add-code', ['model' => $model]); } }
public function actionChangePassword() { $model = new ChangePasswordForm(); if ($model->load(Yii::$app->request->post()) && $model->change()) { AlertHelper::appendAlert('success', Yii::t('happycode', 'Your password was changed.')); return $this->goBack(); } else { return $this->render('change-password', ['model' => $model]); } }