robots(); } if ($name === 'sitemap.xml') { require_once __DIR__ . '/SeoController.php'; $seo = new SeoController(); return $seo->sitemap(); } $routeName = str_replace(['.xml', '.txt'], '', $name); $allowedRoutes = ['about', 'imprint', 'privacy']; if (in_array($routeName, $allowedRoutes)) { return $this->{$routeName}(); } if ($routeName !== 'home' && $routeName !== '') { throw new Exception("Route not found."); } $this->view('home', [ 'name' => $name ]); } // Static Views public function about() { $this->view('about'); } public function imprint() { $this->view('imprint'); } public function privacy() { $this->view('privacy'); } }