Story 3.2: router php urls

This commit is contained in:
2026-02-04 17:06:28 +01:00
parent d520fe848f
commit 0409bb1327
13 changed files with 253 additions and 34 deletions

24
pages/project-single.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
$currentPage = '';
$slug = $GLOBALS['routeParams'][0] ?? null;
$project = $slug ? getProjectBySlug($slug) : null;
if (!$project) {
http_response_code(404);
include __DIR__ . '/404.php';
exit;
}
$pageTitle = $project['title'] ?? 'Projet';
include_template('header', compact('pageTitle'));
include_template('navbar', compact('currentPage'));
?>
<main class="min-h-screen">
<div class="container-content py-20">
<h1 class="text-heading mb-4"><?= htmlspecialchars($project['title'], ENT_QUOTES, 'UTF-8') ?></h1>
<p class="text-text-secondary">Page projet en construction.</p>
</div>
</main>
<?php include_template('footer'); ?>