Skip to content

Commit cc8b32e

Browse files
authored
add $segment option in pager call by Model.php
add the $segment option when the Pager library is call by the model paginate function
1 parent bf135da commit cc8b32e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

system/Model.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ public function chunk(int $size, Closure $userFunc)
11291129
*
11301130
* @return array|null
11311131
*/
1132-
public function paginate(int $perPage = null, string $group = 'default', int $page = 0)
1132+
public function paginate(int $perPage = null, string $group = 'default', int $page = 0, int $segment = 0)
11331133
{
11341134
$pager = \Config\Services::pager(null, null, false);
11351135
$page = $page >= 1 ? $page : $pager->getCurrentPage($group);
@@ -1138,7 +1138,7 @@ public function paginate(int $perPage = null, string $group = 'default', int $pa
11381138

11391139
// Store it in the Pager library so it can be
11401140
// paginated in the views.
1141-
$this->pager = $pager->store($group, $page, $perPage, $total);
1141+
$this->pager = $pager->store($group, $page, $perPage, $total,$segment);
11421142
$perPage = $this->pager->getPerPage($group);
11431143
$offset = ($page - 1) * $perPage;
11441144

0 commit comments

Comments
 (0)