aboutsummaryrefslogtreecommitdiffstats
path: root/core/functions.php
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2021-07-22 18:45:52 +0200
committerThomas Lange <code@nerdmind.de>2021-07-22 18:47:32 +0200
commitf2d9607438670550661fe423eaf26bc24f22bc9e (patch)
treeaf8de3f9e55f5aad681024b9351e6e89f37d2f48 /core/functions.php
parentc2cf93a2a492623eba55c1e78123cd3137cdb426 (diff)
downloadblog-f2d9607438670550661fe423eaf26bc24f22bc9e.tar.gz
blog-f2d9607438670550661fe423eaf26bc24f22bc9e.tar.xz
blog-f2d9607438670550661fe423eaf26bc24f22bc9e.zip
Merge GET parameters into pagination URL
Diffstat (limited to 'core/functions.php')
-rw-r--r--core/functions.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/functions.php b/core/functions.php
index cf35aa9..38af934 100644
--- a/core/functions.php
+++ b/core/functions.php
@@ -17,10 +17,13 @@ use Parsers\MarkdownParser;
# Create generic pagination template
#===============================================================================
function createPaginationTemplate($current, $last, string $location): Template {
+ $params = http_build_query(array_merge($_GET, ['site' => '__SITE__']));
+ $params = str_replace('__SITE__', '%d', $params);
+
$Pagination = TemplateFactory::build('pagination');
$Pagination->set('THIS', $current);
$Pagination->set('LAST', $last);
- $Pagination->set('HREF', "{$location}?site=%d");
+ $Pagination->set('HREF', "{$location}?{$params}");
return $Pagination;
}