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 center-align"> |
16 | <?php if ($pager->getCurrentPage() - $pager->getSurround() > 1) : ?> |
17 | <li class="waves-effect"> |
18 | <a href="<?= $pager->getFirstPageUrl() ?>"><?= $pager->getLanguage() |
19 | ->render('pagination', 'first') ?></a> |
20 | </li> |
21 | <?php endif ?> |
22 | |
23 | <?php if ($pager->getPreviousPage()) : ?> |
24 | <li class="waves-effect"> |
25 | <a rel="prev" href="<?= $pager->getPreviousPageUrl() ?>" title="<?= |
26 | $language->render('pagination', 'previous') ?>"> |
27 | <i class="material-icons">chevron_left</i> |
28 | </a> |
29 | </li> |
30 | <?php endif ?> |
31 | |
32 | <?php foreach ($pager->getPreviousPagesUrls() as $p => $url) : ?> |
33 | <li class="waves-effect"> |
34 | <a href="<?= $url ?>"><?= $p ?></a> |
35 | </li> |
36 | <?php endforeach ?> |
37 | |
38 | <li class="active"> |
39 | <a rel="canonical" href="<?= $pager->getCurrentPageUrl() ?>"> |
40 | <?= $pager->getCurrentPage() ?> |
41 | </a> |
42 | </li> |
43 | |
44 | <?php foreach ($pager->getNextPagesUrls() as $p => $url) : ?> |
45 | <li class="waves-effect"> |
46 | <a href="<?= $url ?>"><?= $p ?></a> |
47 | </li> |
48 | <?php endforeach ?> |
49 | |
50 | <?php if ($pager->getNextPage() && $pager->getNextPage() < $pager->getLastPage() + 1) : ?> |
51 | <li class="waves-effect"> |
52 | <a rel="next" href="<?= $pager->getNextPageUrl() ?>" title="<?= |
53 | $language->render('pagination', 'next') ?>"> |
54 | <i class="material-icons">chevron_right</i> |
55 | </a> |
56 | </li> |
57 | <?php endif ?> |
58 | |
59 | <?php if ($pager->getLastPage() |
60 | && $pager->getCurrentPage() + $pager->getSurround() < $pager->getLastPage() |
61 | ) : ?> |
62 | <li class="waves-effect"> |
63 | <a href="<?= $pager->getLastPageUrl() ?>"><?= $pager->getLanguage() |
64 | ->render('pagination', 'last') ?></a> |
65 | </li> |
66 | <?php endif ?> |
67 | </ul> |
68 |