CodeIgniter4/system/Pager/Views/default_head.php

28 lines
644 B
PHP
Raw Normal View History

2018-11-16 10:33:32 -02:00
<?php
2020-10-24 16:38:41 +08:00
2018-11-16 10:33:32 -02:00
/**
2021-07-19 21:32:33 +08:00
* This file is part of CodeIgniter 4 framework.
2020-10-24 16:38:41 +08:00
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
2021-07-19 21:32:33 +08:00
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
2018-11-16 10:33:32 -02:00
*/
2021-01-05 22:20:17 +07:00
use CodeIgniter\Pager\PagerRenderer;
2021-06-11 23:14:51 +08:00
/**
* @var PagerRenderer $pager
*/
$pager->setSurroundCount(0);
2021-06-07 19:06:26 +08:00
if ($pager->hasPrevious()) {
2021-06-04 22:51:52 +08:00
echo '<link rel="prev" href="' . $pager->getPrevious() . '">' . PHP_EOL;
2018-11-16 10:33:32 -02:00
}
echo '<link rel="canonical" href="' . $pager->getCurrent() . '">' . PHP_EOL;
2018-11-16 10:33:32 -02:00
2021-06-07 19:06:26 +08:00
if ($pager->hasNext()) {
2021-06-04 22:51:52 +08:00
echo '<link rel="next" href="' . $pager->getNext() . '">' . PHP_EOL;
2018-11-16 10:33:32 -02:00
}