Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
10 / 10 |
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 | * HTTP Header Link. |
| 12 | * |
| 13 | * @see https://tools.ietf.org/html/rfc5988 |
| 14 | * |
| 15 | * @var Framework\Pagination\Pager $pager |
| 16 | */ |
| 17 | $links = ''; |
| 18 | |
| 19 | if ($pager->getPreviousPage()) { |
| 20 | $links .= '<' . $pager->getFirstPageUrl() . '>; rel="first",'; |
| 21 | $links .= '<' . $pager->getPreviousPageUrl() . '>; rel="prev"'; |
| 22 | } |
| 23 | |
| 24 | if ($pager->getNextPage()) { |
| 25 | if ($links !== '') { |
| 26 | $links .= ','; |
| 27 | } |
| 28 | $links .= '<' . $pager->getNextPageUrl() . '>; rel="next",'; |
| 29 | $links .= '<' . $pager->getLastPageUrl() . '>; rel="last"'; |
| 30 | } |
| 31 | |
| 32 | echo $links; |