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>
|
<header>
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<?php
|
<li><a href="/">
|
||||||
foreach ($array_header as $key => $value) {
|
<img src="/static/img/logo.png" alt="Logo">
|
||||||
echo '<li><a href="'.$value.'">'.$key.'</a></li>';
|
</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>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
Loading…
Reference in New Issue
Block a user