gamesshop/src/templates/layout/main.php
2024-10-30 19:40:26 +01:00

49 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
use GamesShop\Templates\ResourceIndex;
use League\Plates\Template\Template;
assert($this instanceof Template);
/** @var ResourceIndex $resources */
assert($resources instanceof ResourceIndex);
if (!isset($resourceEntry)) {
throw new Exception("Resource entry not set");
}
/**
* @var string $resourceEntry
*/
$resource = $resources->getResource($resourceEntry);
?>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Game Shop</title>
<?php foreach ($resource->js as $js): ?>
<script src="/<?= $js ?>"></script>
<?php endforeach; ?>
<?php foreach ($resource->css as $css): ?>
<link rel="stylesheet" href="/<?= $css ?>">
<?php endforeach; ?>
</head>
<body class="vh-100 d-flex flex-column">
<?= $this->insert('layout/navbar') ?>
<main class="mt-2 position-relative flex-grow-1">
<?= $this->section('content'); ?>
</main>
<?= $this->section('modal') ?>
<div class="position-absolute bottom-0 start-50 opacity-25 text-center translate-middle-x">
<span class="h1">PROTOTYPE / POC</span>
</div>
</body>
</html>