Esempio n. 1
0
 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]);
     }
 }
Esempio n. 2
0
 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]);
     }
 }