Skip to content

Commit

Permalink
Add escape false to PaginationHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Oct 4, 2016
1 parent 64db8ce commit 51b1415
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/View/Helper/PaginatorHelper.php
Expand Up @@ -468,16 +468,29 @@ public function sort($key, $title = null, array $options = [])
/**
* Merges passed URL options with current pagination state to generate a pagination URL.
*
* ### Options:
*
* - `escape`: If false, the URL will be returned unescaped, do only use if it is manually
* escaped afterwards before being displayed.
* - `fullBase`: If true, the full base URL will be prepended to the result
*
* @param array $options Pagination/URL options array
* @param string|null $model Which model to paginate on
* @param bool $full If true, the full base URL will be prepended to the result
* @param bool $full If true, the full base URL will be prepended to the result @deprecated Use $options and `fullBase`.
* @return string By default, returns a full pagination URL string for use in non-standard contexts (i.e. JavaScript)
* @link http://book.cakephp.org/3.0/en/views/helpers/paginator.html#generating-pagination-urls
*/
public function generateUrl(array $options = [], $model = null, $full = false)
{
$paging = $this->params($model);
$paging += ['page' => null, 'sort' => null, 'direction' => null, 'limit' => null];

$defaults = [
'escape' => true,
'fullBase' => $full
];
$options += $defaults;

$url = [
'page' => $paging['page'],
'limit' => $paging['limit'],
Expand Down Expand Up @@ -518,7 +531,7 @@ public function generateUrl(array $options = [], $model = null, $full = false)
}
}

return $this->Url->build($url, $full);
return $this->Url->build($url, $options);
}

/**
Expand Down

0 comments on commit 51b1415

Please sign in to comment.