Skip to content

Commit 9c68b6f

Browse files
authored
Ext makeLinks
Allows to specify a preconfigured group in a makeLinks method.
1 parent cb3616f commit 9c68b6f

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

system/Pager/Pager.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,20 +147,22 @@ public function simpleLinks(string $group = 'default', string $template = 'defau
147147
* @param integer $page
148148
* @param integer $perPage
149149
* @param integer $total
150-
* @param string $template The output template alias to render.
151-
* @param integer $segment (if page number is provided by URI segment)
150+
* @param string $template The output template alias to render.
151+
* @param integer $segment (if page number is provided by URI segment)
152152
*
153+
* @param string|null $group optional group (i.e. if we'd like to define custom path)
153154
* @return string
154155
*/
155-
public function makeLinks(int $page, int $perPage, int $total, string $template = 'default_full', int $segment = 0): string
156+
public function makeLinks(int $page, int $perPage, int $total, string $template = 'default_full', int $segment = 0, ?string $group = null): string
156157
{
157158
$name = time();
158159

159-
$this->store($name, $page, $perPage, $total, $segment);
160+
$this->store($group ?? $name, $page, $perPage, $total, $segment);
160161

161-
return $this->displayLinks($name, $template);
162+
return $this->displayLinks($group ?? $name, $template);
162163
}
163164

165+
164166
//--------------------------------------------------------------------
165167

166168
/**

0 commit comments

Comments
 (0)