Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add $segment parameter in pager call by Model.php #2843

Merged
merged 3 commits into from
Apr 22, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions system/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ public function chunk(int $size, Closure $userFunc)
*
* @return array|null
*/
public function paginate(int $perPage = null, string $group = 'default', int $page = 0)
public function paginate(int $perPage = null, string $group = 'default', int $page = 0, int $segment = 0)
{
$pager = \Config\Services::pager(null, null, false);
$page = $page >= 1 ? $page : $pager->getCurrentPage($group);
Expand All @@ -1138,7 +1138,7 @@ public function paginate(int $perPage = null, string $group = 'default', int $pa

// Store it in the Pager library so it can be
// paginated in the views.
$this->pager = $pager->store($group, $page, $perPage, $total);
$this->pager = $pager->store($group, $page, $perPage, $total,$segment);
paul45 marked this conversation as resolved.
Show resolved Hide resolved
$perPage = $this->pager->getPerPage($group);
$offset = ($page - 1) * $perPage;

Expand Down