Skip to content
Snippets Groups Projects
Commit fe97a9f2 authored by NaufalArdanni's avatar NaufalArdanni Committed by DewanaGustavus
Browse files

fix: style 404 Not Found page

parent c4d73a3c
Branches
Tags
No related merge requests found
......@@ -3,10 +3,19 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../../public/styles/home/Home.css">
<link rel="stylesheet" href="../../public/styles/Global.css">
<title>404 Not Found</title>
</head>
<body>
404 Not Found
<?php
include(dirname(__DIR__) . '/template/Navbar.php');
?>
<main>
<h1>404 Not Found</h1>
<p>The requested page does not exist.</p>
</main>
</body>
</html>
\ No newline at end of file
......@@ -24,7 +24,7 @@ class Routing {
$filename = str_replace('.php', '', $url[1]);
$filename = ucfirst($filename);
$controllerName = $filename . "Controller";
$controllerFile = $controllerDir . '/' . $routes[$filename] . '/' . $controllerName . '.php';
$controllerFile = $controllerDir . '/' . ($routes[$filename] ?? '') . '/' . $controllerName . '.php';
if(!file_exists($controllerFile)) {
$controllerName = "NotFoundController";
$controllerFile = $controllerDir . '/home/' . $controllerName . '.php';
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment