Implement entry page with dynamic content and update template structure

This commit is contained in:
marc-go committed 2026-10-05 19:25:13 +02:00
1 parent 1a2e1cc33f
commit 0c73ad14f5
8 files changed
+79 -6

No files matched your search

+27
View File
@@ -8,3 +8,30 @@ require "main.php";
// Init GB Class
$gb = new gb(true);
// Load HTMLLoader Library
require FRONTEND_PATH . "html_loader.php";
$htmlLoader = new HTMLLoader();
// Build Entry Page
$htmlLoader->setTemplate("entrys_frontend");
$url = "http://" . APP_DOMAIN . "/api/entrys/get.php";
$response = file_get_contents($url);
$entrys = json_decode($response, true);
$entrys = $entrys["entrys"];
$html_block = "";
foreach($entrys as $entry) {
$name = $entry["name"];
$text = $entry["text"];
$html_block .= '
<div class="entry">
<h3>' . $name . '</h3>
<p>' . $text . '</p>
</div>
';
}
$htmlLoader->show(["%entrys%" => $html_block]);