Skip to content

Commit 9230bfe

Browse files
authored
Update Pagination.php
1 parent 7b73caf commit 9230bfe

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/data/Pagination.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,19 @@ public function setPerPage($perPage)
175175
* @param integer $perPage
176176
* @return string
177177
*/
178-
public function createUrl($page, $prePage=null)
178+
public function createUrl($page, $perPage=null)
179179
{
180180
$requestUri = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
181181
// Add or reset page parameter
182-
$_GET[$this->pageParam] = (int) $page;
182+
$page = (int) $page;
183183
if ($this->perPageParam) {
184-
$_GET[$this->perPageParam] = ($prePage) ? $prePage : $this->perPage;
184+
$perPage = ($perPage) ? $perPage : $this->perPage;
185185
}
186186
// Build URL
187-
$url = "//{$_SERVER['HTTP_HOST']}{$requestUri}?" . http_build_query($_GET);
187+
$url = "//{$_SERVER['HTTP_HOST']}{$requestUri}?" . http_build_query(array_merge($_GET, [
188+
$this->pageParam => $page,
189+
$this->perPageParam => $perPage,
190+
]));
188191

189192
return $url;
190193
}

0 commit comments

Comments
 (0)