Skip to content
Permalink
Browse files

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().
  • Loading branch information...
MohsenEkhtiari committed Oct 7, 2015
1 parent 19ad6dc commit f57cdb7568d4998ad5e94d06d2b599f74210adda
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/Cake/View/Helper/PaginatorHelper.php
@@ -988,17 +988,18 @@ public function last($last = 'last >>', $options = array()) {
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);

0 comments on commit f57cdb7

Please sign in to comment.
You can’t perform that action at this time.