Story 1.3: templates php base

This commit is contained in:
2026-02-04 15:33:03 +01:00
parent e1395a235e
commit 2aa77a8c10
10 changed files with 175 additions and 49 deletions

11
includes/functions.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
/**
* Inclut un template avec des données
* @param string $name Nom du template (sans .php)
* @param array $data Variables à passer au template
*/
function include_template(string $name, array $data = []): void
{
extract($data, EXTR_SKIP);
include __DIR__ . "/../templates/{$name}.php";
}