public function enter()
 {
     $model = new Model_User();
     if (empty($_POST['email'])) {
         $errors[] = 'Вы не ввели email!';
     }
     if (empty($_POST['password'])) {
         $errors[] = 'Вы не ввели пароль!';
     }
     if (!empty($_POST['email']) and !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
         $errors[] = 'Введите валидный email!';
     }
     if (!empty($_POST['password']) and strlen($_POST['password']) < 6) {
         $errors[] = 'Пароль должен содержать не менее 6 символов!';
     }
     if (!empty($errors)) {
         $this->template->vars('errors', $errors);
         $this->template->view('login');
     }
     if (empty($errors)) {
         $data = ['email' => $_POST['email'], 'password' => $_POST['password']];
         $user = $model->user_enter($data);
         if ($user) {
             $model->redirect('/weather');
         } else {
             $errors[] = 'Неверный email или пароль';
             $this->template->vars('errors', $errors);
             $this->template->view('login');
         }
     }
 }