Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
30 / 30 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | /* |
3 | * This file is part of Aplus Framework Pagination Library. |
4 | * |
5 | * (c) Natan Felles <natanfelles@gmail.com> |
6 | * |
7 | * For the full copyright and license information, please view the LICENSE |
8 | * file that was distributed with this source code. |
9 | */ |
10 | /** |
11 | * @var Framework\Pagination\Pager $pager |
12 | */ |
13 | $language = $pager->getLanguage(); |
14 | ?> |
15 | <ul class="pagination justify-content-center"> |
16 | <?php if ($pager->getCurrentPage() - $pager->getSurround() > 1) : ?> |
17 | <li class="page-item"> |
18 | <a class="page-link" href="<?= $pager->getFirstPageUrl() ?>"><?= $pager->getLanguage() |
19 | ->render('pagination', 'first') ?></a> |
20 | </li> |
21 | <?php endif ?> |
22 | |
23 | <?php if ($pager->getPreviousPage()) : ?> |
24 | <li class="page-item"> |
25 | <a class="page-link" rel="prev" href="<?= $pager->getPreviousPageUrl() ?>" title="<?= |
26 | $language->render('pagination', 'previous') ?>">«</a> |
27 | </li> |
28 | <?php endif ?> |
29 | |
30 | <?php foreach ($pager->getPreviousPagesUrls() as $p => $url) : ?> |
31 | <li class="page-item"> |
32 | <a class="page-link" href="<?= $url ?>"><?= $p ?></a> |
33 | </li> |
34 | <?php endforeach ?> |
35 | |
36 | <li class="page-item active"> |
37 | <a class="page-link" rel="canonical" href="<?= $pager->getCurrentPageUrl() ?>"> |
38 | <?= $pager->getCurrentPage() ?> |
39 | </a> |
40 | </li> |
41 | |
42 | <?php foreach ($pager->getNextPagesUrls() as $p => $url) : ?> |
43 | <li class="page-item"> |
44 | <a class="page-link" href="<?= $url ?>"><?= $p ?></a> |
45 | </li> |
46 | <?php endforeach ?> |
47 | |
48 | <?php if ($pager->getNextPage() && $pager->getNextPage() < $pager->getLastPage() + 1) : ?> |
49 | <li class="page-item"> |
50 | <a class="page-link" rel="next" href="<?= $pager->getNextPageUrl() ?>" title="<?= |
51 | $language->render('pagination', 'next') ?>">»</a> |
52 | </li> |
53 | <?php endif ?> |
54 | |
55 | <?php if ($pager->getLastPage() |
56 | && $pager->getCurrentPage() + $pager->getSurround() < $pager->getLastPage() |
57 | ) : ?> |
58 | <li class="page-item"> |
59 | <a class="page-link" href="<?= $pager->getLastPageUrl() ?>"><?= $pager->getLanguage() |
60 | ->render('pagination', 'last') ?></a> |
61 | </li> |
62 | <?php endif ?> |
63 | </ul> |