51 lines
911 B
PHP
51 lines
911 B
PHP
<?php
|
|
|
|
$nav = [
|
|
[
|
|
'href' => 'index.php',
|
|
'label' => 'Accueil',
|
|
],
|
|
[
|
|
'href' => 'contact.php',
|
|
'label' => 'Contact',
|
|
],
|
|
[
|
|
'href' => 'news.php',
|
|
'label' => 'Actualités',
|
|
],
|
|
];
|
|
|
|
if (!isset($currentPage)) {
|
|
$currentPage = 'index.php';
|
|
}
|
|
|
|
if (!isset($pageTitle)) {
|
|
$pageTitle = '';
|
|
}
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title><?php echo $pageTitle; ?></title>
|
|
<style>
|
|
.active a {
|
|
color: red;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<nav>
|
|
<ul>
|
|
<?php foreach ($nav as $item): ?>
|
|
<li <?php if ($item['href'] === $currentPage): ?>class="active"<?php endif; ?>>
|
|
<a href="<?php echo $item['href']; ?>">
|
|
<?php echo $item['label']; ?>
|
|
</a>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</nav>
|