We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9230bfe commit 76fd1f6Copy full SHA for 76fd1f6
src/data/Pagination.php
@@ -179,15 +179,12 @@ public function createUrl($page, $perPage=null)
179
{
180
$requestUri = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
181
// Add or reset page parameter
182
- $page = (int) $page;
+ $params[$this->pageParam] = (int) $page;
183
if ($this->perPageParam) {
184
- $perPage = ($perPage) ? $perPage : $this->perPage;
+ $params[$this->perPageParam] = ($perPage) ? $perPage : $this->perPage;
185
}
186
// Build URL
187
- $url = "//{$_SERVER['HTTP_HOST']}{$requestUri}?" . http_build_query(array_merge($_GET, [
188
- $this->pageParam => $page,
189
- $this->perPageParam => $perPage,
190
- ]));
+ $url = "//{$_SERVER['HTTP_HOST']}{$requestUri}?" . http_build_query(array_merge($_GET, $params));
191
192
return $url;
193
0 commit comments