db = new CourseModel(); $this->view = $view; } public function showCourse(){ $id = $_GET["courseId"] ?? null; if(!$id){ header('Location: index.php'); exit; } $kurs = $this->db->getCourseById($id); if(!$kurs){ new \Blog\Library\ErrorMsg("Kurs nicht gefunden"); } $this->view->setVars([ "kurs" => $kurs ]); } }