forked from NetCommons3/NetCommons
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpaginator.ctp
More file actions
49 lines (44 loc) · 1.19 KB
/
paginator.ctp
File metadata and controls
49 lines (44 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* Paginator template
* - $modulus: `modulus` how many numbers to include on either side of the current page, defaults to 8(display of 7 pages).
* - $url: Url of the action. See Router::url()
*
* @author Noriko Arai <arai@nii.ac.jp>
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @copyright Copyright 2014, NetCommons Project
*/
$firstOption = array(
'tag' => 'li',
);
$numbersOption = array(
'tag' => 'li',
'currentTag' => 'a',
'currentClass' => 'active',
'separator' => '',
'first' => false,
'last' => false,
);
$lastOption = array(
'tag' => 'li',
);
if (isset($modulus)) {
$numbersOption['modulus'] = $modulus;
}
if (isset($url)) {
$firstOption['url'] = $url;
$numbersOption['url'] = $url;
$lastOption['url'] = $url;
}
?>
<?php if ((int)$this->Paginator->counter('{:pages}') > 1) : ?>
<div class="text-center">
<ul class="pagination">
<?php echo $this->Paginator->first('«', $firstOption); ?>
<?php echo $this->Paginator->numbers($numbersOption); ?>
<?php echo $this->Paginator->last('»', $lastOption); ?>
</ul>
</div>
<?php endif;