✨ Story 3.2: router php urls
This commit is contained in:
24
pages/project-single.php
Normal file
24
pages/project-single.php
Normal 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'); ?>
|
||||
Reference in New Issue
Block a user