init
This commit is contained in:
commit
12745669ab
5 changed files with 98 additions and 0 deletions
14
contact.php
Normal file
14
contact.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
$currentPage = 'contact.php';
|
||||
$pageTitle = 'Contact';
|
||||
|
||||
require __DIR__.'/elements/header.php';
|
||||
|
||||
?>
|
||||
|
||||
<p>La page de contact<p>
|
||||
|
||||
<?php
|
||||
|
||||
require __DIR__.'/elements/footer.php';
|
||||
6
elements/footer.php
Normal file
6
elements/footer.php
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
<footer>
|
||||
<p>Pied de page</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
50
elements/header.php
Normal file
50
elements/header.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?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>
|
||||
14
index.php
Normal file
14
index.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
$currentPage = 'index.php';
|
||||
$pageTitle = 'Accueil';
|
||||
|
||||
require __DIR__.'/elements/header.php';
|
||||
|
||||
?>
|
||||
|
||||
<p>La page d'accueil</p>
|
||||
|
||||
<?php
|
||||
|
||||
require __DIR__.'/elements/footer.php';
|
||||
14
news.php
Normal file
14
news.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
$currentPage = 'news.php';
|
||||
$pageTitle = 'Actualités';
|
||||
|
||||
require __DIR__.'/elements/header.php';
|
||||
|
||||
?>
|
||||
|
||||
<p>La page d'actu</p>
|
||||
|
||||
<?php
|
||||
|
||||
require __DIR__.'/elements/footer.php';
|
||||
Loading…
Add table
Add a link
Reference in a new issue