public function login() { $user = new \models\User('login'); if (!empty($_POST)) { $user->login = $_POST['login']; $user->password = $_POST['password']; if ($user->authorize()) { $this->redirect('/'); } } $this->render('login', ['user' => $user]); }