chore(*.php): use pint for php formatting
This commit is contained in:
parent
bd1855a65e
commit
753f3433ce
40 changed files with 2261 additions and 1900 deletions
|
@ -1,41 +1,43 @@
|
|||
<?php
|
||||
|
||||
if (!function_exists('renderPaginator')) {
|
||||
if (! function_exists('renderPaginator')) {
|
||||
function renderPaginator(array $pagination, int $totalPages): void
|
||||
{
|
||||
if (!$pagination || $totalPages <= 1) return;
|
||||
?>
|
||||
if (! $pagination || $totalPages <= 1) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
|
||||
<script type="module" src="/assets/scripts/components/select-pagination.js" defer></script>
|
||||
<nav aria-label="Pagination" class="pagination">
|
||||
<?php if (!empty($pagination['href']['previous'])): ?>
|
||||
<?php if (! empty($pagination['href']['previous'])) { ?>
|
||||
<a href="<?= $pagination['href']['previous'] ?>" aria-label="Previous page">
|
||||
<?= getTablerIcon('arrow-left') ?>
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<?php } else { ?>
|
||||
<span><?= getTablerIcon('arrow-left') ?></span>
|
||||
<?php endif; ?>
|
||||
<?php } ?>
|
||||
<select-pagination data-base-index="1">
|
||||
<select class="client-side" aria-label="Page selection">
|
||||
<?php foreach ($pagination['pages'] as $i): ?>
|
||||
<?php foreach ($pagination['pages'] as $i) { ?>
|
||||
<option value="<?= $i ?>" <?= ($pagination['pageNumber'] === $i) ? 'selected' : '' ?>>
|
||||
<?= $i ?> of <?= $totalPages ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<noscript>
|
||||
<p><span aria-current="page"><?= $pagination['pageNumber'] ?></span> of <?= $totalPages ?></p>
|
||||
</noscript>
|
||||
</select-pagination>
|
||||
<?php if (!empty($pagination['href']['next'])): ?>
|
||||
<?php if (! empty($pagination['href']['next'])) { ?>
|
||||
<a href="<?= $pagination['href']['next'] ?>" aria-label="Next page">
|
||||
<?= getTablerIcon('arrow-right') ?>
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<?php } else { ?>
|
||||
<span><?= getTablerIcon('arrow-right') ?></span>
|
||||
<?php endif; ?>
|
||||
<?php } ?>
|
||||
</nav>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue