Use plain HTML in the header + only show 'Nouvelle recette' if user is login
This commit is contained in:
parent
fce1da9070
commit
488fc7c510
@ -1,20 +1,18 @@
|
||||
<?php
|
||||
$array_header = array(
|
||||
'<img src="/static/img/logo.png" alt="Logo">' => "/",
|
||||
"Catégories" => "/category",
|
||||
"Nouvelle recette" => "/recipe/new",
|
||||
"Recherche" => "rechercher",
|
||||
'<img src="/static/img/default_user.svg" type="image/svg+xml">' => "/user/view"
|
||||
);
|
||||
?>
|
||||
<header>
|
||||
<nav>
|
||||
<ul>
|
||||
<?php
|
||||
foreach ($array_header as $key => $value) {
|
||||
echo '<li><a href="'.$value.'">'.$key.'</a></li>';
|
||||
}
|
||||
?>
|
||||
<li><a href="/">
|
||||
<img src="/static/img/logo.png" alt="Logo">
|
||||
</a></li>
|
||||
<li><a href="/category">Catégories</a></li>
|
||||
<?php if (Session::is_login()) { ?>
|
||||
<li><a href="/recipe/new">Nouvelle recette</a></li>
|
||||
<?php } ?>
|
||||
<li><a href="/recipe/search">Rechercher</a></li>
|
||||
<li><a href="/user/view">
|
||||
<img src="/static/img/default_user.svg" type="image/svg+xml">
|
||||
</a></li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
Loading…
Reference in New Issue
Block a user