Files
laysense.cn/app/view/footer.php
T

28 lines
1.4 KiB
PHP

<?php
use App\Content\View;
$e = View::escape(...);
$data = $footer['payload'];
$brand = $data['brand'] ?: $site['name'];
?>
<footer class="site-footer site-footer-<?= $e($footer['preset']) ?>" id="contact"<?= $showFooter ? '' : ' hidden' ?>>
<div class="wrap site-footer-components">
<?php foreach ($data['components'] as $component): ?>
<?php if ($component === 'brand'): ?>
<a class="wordmark site-brand" href="/" aria-label="<?= $e($brand) ?>,首页">
<?php if ($data['logo'] !== ''): ?><img src="<?= $e($data['logo']) ?>" alt="<?= $e($brand) ?>" loading="lazy"><?php else: ?><?= $e($brand) ?><?php endif ?>
</a>
<?php elseif ($component === 'text' && $data['text'] !== ''): ?>
<p class="site-footer-text"><?= $e($data['text']) ?></p>
<?php elseif ($component === 'links' && $data['links']): ?>
<nav class="site-footer-nav" aria-label="页脚导航">
<?php foreach ($data['links'] as [$url, $label]): ?><a href="<?= $e($url) ?>"><?= $e($label) ?></a><?php endforeach ?>
</nav>
<?php elseif ($component === 'legal' && $data['legal'] !== ''): ?>
<small><?= $e($data['legal']) ?></small>
<?php endif ?>
<?php endforeach ?>
<small class="site-footer-credit">Powered by <a href="https://laysense.cn/laysite">LaySite</a></small>
</div>
</footer>