Story 4.5: temoignages

This commit is contained in:
2026-02-04 18:43:54 +01:00
parent c492208939
commit 325625f664
8 changed files with 225 additions and 25 deletions

View File

@@ -150,4 +150,34 @@ function getToolIcon(string $icon): string
];
return $icons[$icon] ?? '🛠';
}
/**
* Récupère tous les témoignages
*/
function getTestimonials(): array
{
$data = loadJsonData('testimonials.json');
return $data['testimonials'] ?? [];
}
/**
* Récupère les témoignages mis en avant
*/
function getFeaturedTestimonials(): array
{
return array_values(array_filter(getTestimonials(), fn($t) => ($t['featured'] ?? false) === true));
}
/**
* Récupère le témoignage lié à un projet
*/
function getTestimonialByProject(string $projectSlug): ?array
{
foreach (getTestimonials() as $testimonial) {
if (($testimonial['project_slug'] ?? '') === $projectSlug) {
return $testimonial;
}
}
return null;
}