File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ class Pagination
7474 *
7575 * @var array
7676 */
77- public $ params ;
77+ public $ params = [] ;
7878
7979 /**
8080 * Total number of items
@@ -183,8 +183,10 @@ public function createUrl($page, $perPage=null)
183183 if ($ this ->perPageParam ) {
184184 $ params [$ this ->perPageParam ] = ($ perPage ) ? $ perPage : $ this ->perPage ;
185185 }
186+ // Verify $this->params
187+ $ this ->params = is_array ($ this ->params ) ? $ this ->params : [];
186188 // Build URL
187- $ url = "// {$ _SERVER ['HTTP_HOST ' ]}{$ requestUri }? " . http_build_query (array_merge ($ _GET , $ params ));
189+ $ url = "// {$ _SERVER ['HTTP_HOST ' ]}{$ requestUri }? " . http_build_query (array_merge ($ _GET , $ this -> params , $ params ));
188190
189191 return $ url ;
190192 }
Original file line number Diff line number Diff line change 77
88$ pagination = new \yidas \data \Pagination ([
99 'totalCount ' => $ count ,
10+ 'params ' => [
11+ 'key ' => 'value ' ,
12+ ],
1013]);
1114
1215?>
You can’t perform that action at this time.
0 commit comments