From d96bbd2e2a97fc93afba73b3067f72ba21717116 Mon Sep 17 00:00:00 2001 From: bruno Date: Thu, 11 Jan 2024 10:14:21 +0100 Subject: [PATCH] test --- index.php | 4 +++- templates/nav.html | 4 +--- templates/navpages.php | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 templates/navpages.php diff --git a/index.php b/index.php index 2ea256c..a0221a0 100644 --- a/index.php +++ b/index.php @@ -52,7 +52,9 @@ else{ $page = file_get_contents($template_dir . "404.html"); } -$nav = str_replace("href=\"/$page_name\"", "href=\"/$page_name\" class=\"active\"", $nav); +$navpages = include_once $template_dir . "navpages.php"; + +$nav = str_replace("__NAV_PAGES__", $navpages, $nav); $out = $skeleton; $out = str_replace("__TEMPLATE__NAV__", $nav, $out); diff --git a/templates/nav.html b/templates/nav.html index 06cc4ac..2be64f0 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -1,8 +1,6 @@ \ No newline at end of file diff --git a/templates/navpages.php b/templates/navpages.php new file mode 100644 index 0000000..8dd3c3a --- /dev/null +++ b/templates/navpages.php @@ -0,0 +1,14 @@ +__NAME__'; + +$page_dir = "/pages"; + +$files1 = scandir($page_dir); + +echo $files1; + +return ob_get_clean(); + +?> \ No newline at end of file