added id for each category to go directly to the section wanted

This commit is contained in:
Capelier-Marla 2023-01-20 10:04:14 +01:00
parent f8e81d6136
commit 95f86e77a4

View File

@ -1,11 +1,18 @@
<?php <?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");
?> ?>
<nav> <nav>
<ul> <ul>
<?php <?php
foreach ($A_view as $categoryName => $recipes) { foreach ($A_view as $categoryName => $recipes) {
echo '<li><section> echo '<li><section id="'.$allCategory[$categoryName].'">
<h1>'.$categoryName.'</h1> <h1>'.$categoryName.'</h1>
<ul>'; <ul>';
foreach ($recipes as $recipe) { foreach ($recipes as $recipe) {