Implement entry page with dynamic content and update template structure
This commit is contained in:
1 parent
1a2e1cc33f
commit
0c73ad14f5
8 files changed
+79
-6
No files matched your search
@@ -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]);
|
||||
Reference in new issue
Block a user