/**
  * Login application action.
  * @return string
  */
 public function actionLogin()
 {
     $model = new LoginForm();
     if ($model->load(Yii::$app->request->post()) && $model->login()) {
         return $this->goHome();
     }
     return $this->render('login', ['model' => $model]);
 }
Example #2
0
 public function testDuration()
 {
     $this->specify("", function () {
         expect("property `duration` should be `1209600` by default", $this->model->getDuration())->same(1209600);
         $this->model->setDuration(123);
         expect('property `duration` should be setting/getting by method', $this->model->getDuration())->same(123);
         $this->model->duration = 123;
         expect('property `duration` should be setting/getting by property', $this->model->duration)->same(123);
     });
 }