public function actionLogin($params = []) { $student = new Student(); if (isset($_POST) && !empty($_POST)) { // TODO: validate user input if ($student->login($_POST['email'], $_POST['password'])) { Router::redirect('/student/profile'); } else { Router::error('401'); } } $this->render('login.php'); }