Skip to content

Commit 2c3400c

Browse files
committed
when sorted, always reset the page, closes KnpLabs#92
1 parent fb45a65 commit 2c3400c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Pagination/SlidingPagination.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function sortable($title, $key, $options = array(), $params = array(), $t
125125
}
126126
$params = array_merge(
127127
$params,
128-
array($this->alias.'sort' => $key, $this->alias.'direction' => $direction)
128+
array($this->alias.'sort' => $key, $this->alias.'direction' => $direction, $this->alias.'page' => 1)
129129
);
130130

131131
$options['href'] = $this->routerHelper->generate($this->route, $params, $options['absolute']);
@@ -139,7 +139,7 @@ public function sortable($title, $key, $options = array(), $params = array(), $t
139139
if ($template) {
140140
$this->sortableTemplate = $template;
141141
}
142-
142+
143143
$alias = $this->alias;
144144

145145
return $this->engine->render($this->sortableTemplate, compact('options', 'title', 'direction', 'sorted', 'key', 'alias'));

0 commit comments

Comments
 (0)