Merge pull request #31 from ThomasRubini/category_list

This commit is contained in:
Thomas Rubini 2023-01-20 09:21:26 +01:00 committed by GitHub
commit 0f85e660ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 8 deletions

View File

@ -7,21 +7,21 @@ final class DefaultController
{
$array_recipes = array(
array(
"LINK" => "/recipe/view/1",
"RECIPE_LINK" => "/recipe/view/1",
"NAME" => "Pâte à crêpe",
"IMG" => "/static/img/recipes/1.jpg",
"IMG_LINK" => "/static/img/recipes/1.jpg",
"NOTE" => "4.5"
),
array(
"LINK" => "/recipe/view/1",
"RECIPE_LINK" => "/recipe/view/1",
"NAME" => "Pâte à crêpe",
"IMG" => "/static/img/recipes/1.jpg",
"IMG_LINK" => "/static/img/recipes/1.jpg",
"NOTE" => "4.5"
),
array(
"LINK" => "/recipe/view/1",
"RECIPE_LINK" => "/recipe/view/1",
"NAME" => "Pâte à crêpe",
"IMG" => "/static/img/recipes/1.jpg",
"IMG_LINK" => "/static/img/recipes/1.jpg",
"NOTE" => "4.5"
),
);

View File

@ -0,0 +1,19 @@
<?php
$allCategory = array(
"Type de cuisson" => "type_de_cuisson",
"Temps de préparation" => "temps_de_preparation",
"Difficulté" => "difficulte",
"Végan" => "vegan",
"Sans gluten" => "sans_gluten",
"Sans lactose" => "sans_lactose");
?>
<aside>
<ul>
<li><h3>Catégories :</h3></li>
<?php
foreach($allCategory as $category => $category_path) {
echo '<li><a href="/category/' . $category_path . '">'. $category . '</a></li>';
}?>
</ul>
</aside>

View File

@ -8,7 +8,6 @@ $array_header = array(
);
?>
<header>
<nav>
<ul>
<?php
@ -18,5 +17,4 @@ $array_header = array(
?>
</ul>
</nav>
</header>

View File

@ -1,5 +1,7 @@
<img src="static/img/bandeau.jpg" alt="Cook">
<?php View::show("common/category_list") ?>
<main>
<section>
<h1> Nos idées recettes: </h1>

View File

@ -1,3 +1,5 @@
<?php View::show("common/category_list") ?>
<main>
<img src="<?= $A_view["IMAGE_URL"] ?>" alt="Image d'illustration de la recette">