public function actionIndex() { $form = new LoginForm(); if (\Yii::$app->request->isPost and $form->load(\Yii::$app->request->post()) and $form->login()) { return $this->goHome(); } return $this->render('index.tpl', array('model' => $form)); }