implement category with a data example
This commit is contained in:
parent
f40498319c
commit
ab085e8591
47
Views/category/category.php
Normal file
47
Views/category/category.php
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
$array_recepies_Type_de_cuisson = array( //test
|
||||||
|
array(
|
||||||
|
"nom" => "Quaso",
|
||||||
|
"img" => "4.jpg",
|
||||||
|
"note" => "4.5"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"nom" => "Quaso",
|
||||||
|
"img" => "4.jpg",
|
||||||
|
"note" => "4.5"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"nom" => "Quaso",
|
||||||
|
"img" => "4.jpg",
|
||||||
|
"note" => "4.5"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$array_categories = array(
|
||||||
|
"Type de cuisson" => $array_recepies_Type_de_cuisson,
|
||||||
|
"Temps de préparation" => $array_recepies_Type_de_cuisson,
|
||||||
|
"Difficulté" => $array_recepies_Type_de_cuisson,
|
||||||
|
"Végan" => $array_recepies_Type_de_cuisson,
|
||||||
|
"Sans gluten" => $array_recepies_Type_de_cuisson,
|
||||||
|
"Sans lactose" => $array_recepies_Type_de_cuisson
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
|
||||||
|
<nav>
|
||||||
|
<ul>
|
||||||
|
<?php
|
||||||
|
foreach ($array_categories as $categoryName => $recipes) {
|
||||||
|
echo '<li><section>
|
||||||
|
<h1>$key</h1>
|
||||||
|
<ul>';
|
||||||
|
foreach ($recipes as $recipe) {
|
||||||
|
echo '<li>';
|
||||||
|
View::show("../common/recipe", $recipe);
|
||||||
|
echo '</li>';
|
||||||
|
}
|
||||||
|
echo '</ul>
|
||||||
|
</section></li>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
Loading…
Reference in New Issue
Block a user