mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
PaginatorHelper::meta() skips url parameters and disrespects defined routes
PaginatorHelper::meta() skips url parameters (passed and named) which results in urls not respecting defined routes. It means PaginatorHelper::meta() does not generate same url as PaginatorHelper::prev() & PaginatorHelper::next().
This commit is contained in:
parent
19ad6dcef2
commit
f57cdb7568
1 changed files with 3 additions and 2 deletions
|
@ -988,17 +988,18 @@ class PaginatorHelper extends AppHelper {
|
|||
public function meta($options = array()) {
|
||||
$model = isset($options['model']) ? $options['model'] : null;
|
||||
$params = $this->params($model);
|
||||
$urlOptions = isset($this->options['url']) ? $this->options['url'] : array();
|
||||
$links = array();
|
||||
if ($this->hasPrev()) {
|
||||
$links[] = $this->Html->meta(array(
|
||||
'rel' => 'prev',
|
||||
'link' => $this->url(array('page' => $params['page'] - 1), true)
|
||||
'link' => $this->url(array_merge($urlOptions, array('page' => $params['page'] - 1)), true)
|
||||
));
|
||||
}
|
||||
if ($this->hasNext()) {
|
||||
$links[] = $this->Html->meta(array(
|
||||
'rel' => 'next',
|
||||
'link' => $this->url(array('page' => $params['page'] + 1), true)
|
||||
'link' => $this->url(array_merge($urlOptions, array('page' => $params['page'] + 1)), true)
|
||||
));
|
||||
}
|
||||
$out = implode($links);
|
||||
|
|
Loading…
Reference in a new issue