dynamic navbar

This commit is contained in:
Joshua Perry 2023-01-23 16:45:07 +00:00
parent d68eb37381
commit 8f485a0832
2 changed files with 3 additions and 2 deletions

View File

@ -32,6 +32,7 @@ class EntryPoint {
$page = $this->routes->getController($controllerName)->$functionName(); $page = $this->routes->getController($controllerName)->$functionName();
$content = $this->loadTemplate('../templates/' . $page['template'], $page['vars']); $content = $this->loadTemplate('../templates/' . $page['template'], $page['vars']);
$nav = $this->loadTemplate('../templates/nav.html.php', $page['vars']);
$title = $page['title']; $title = $page['title'];
require '../templates/layout.html.php'; require '../templates/layout.html.php';
} }

View File

@ -21,10 +21,10 @@
<li><a href="/">Home</a></li> <li><a href="/">Home</a></li>
<li>Jobs <li>Jobs
<ul> <ul>
<?php require 'nav.html.php'?> <?=$nav?>
</ul> </ul>
</li> </li>
<li><a href="?page=about">About Us</a></li> <li><a href="/jobs/about">About Us</a></li>
</ul> </ul>
</nav> </nav>
<img src="../images/randombanner.php"/> <img src="../images/randombanner.php"/>