コード例 #1
0
ファイル: UsuarioController.php プロジェクト: rolion/taller1
 /**
  * Deletes an existing Usuario model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param integer $id
  * @return mixed
  */
 public function actionLogin()
 {
     if (!\Yii::$app->user->isGuest) {
         return $this->goHome();
     }
     $model = new Usuario();
     if ($model->load(Yii::$app->request->post()) && $model->login()) {
         Yii::$app->user->login($model, 3600 * 24 * 30);
         return $this->goHome();
     }
     return $this->render('login', ['model' => $model]);
 }