fixed from error

This commit is contained in:
Torsten Schulz
2023-12-28 17:48:43 +01:00
parent 9f257e569d
commit bc2eefd305
2 changed files with 5 additions and 2 deletions

View File

@@ -52,6 +52,7 @@ class Renderer {
} }
$this->templateName = $templateName ?: (!in_array($scriptName, ['ffajs', 'fvajs', '', '/']) ? $scriptName : 'index'); $this->templateName = $templateName ?: (!in_array($scriptName, ['ffajs', 'fvajs', '', '/']) ? $scriptName : 'index');
$this->connectDb(); $this->connectDb();
$this->content['year'] = date('Y');
} }
private function createPublicMenuItems(): void { private function createPublicMenuItems(): void {
@@ -173,7 +174,9 @@ class Renderer {
} }
private function footer(): void { private function footer(): void {
$this->website = str_replace('{{footer}}', file_get_contents('templates/footer.html'), $this->website); $footerTemplate = file_get_contents('templates/footer.html');
$footer = str_replace('{{year}}', date('Y'), $footerTemplate);
$this->website = str_replace('{{footer}}', $footer, $this->website);
} }
protected function showInputField(array $errors, string $inputType, string $fieldName, int $fieldLength): void { protected function showInputField(array $errors, string $inputType, string $fieldName, int $fieldLength): void {

View File

@@ -1,4 +1,4 @@
<footer> <footer>
<span class="footer-copyright">(c) 2023 Verein der Freunde und Förderer der <a href="https://www.steffi-jones-schule.com" target="_blank">Steffi-Jones-Schule e.V.</a></span> <span class="footer-copyright">&copy; {{year}} Verein der Freunde und Förderer der <a href="https://www.steffi-jones-schule.com" target="_blank">Steffi-Jones-Schule e.V.</a></span>
<a href="imprint" class="footer-imprint">Impressum</a> <a href="imprint" class="footer-imprint">Impressum</a>
</footer> </footer>