✨ Story 1.3: templates php base
This commit is contained in:
11
includes/functions.php
Normal file
11
includes/functions.php
Normal 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";
|
||||
}
|
||||
Reference in New Issue
Block a user