Skip to content
Permalink
Browse files

Add escape false to PaginationHelper

  • Loading branch information...
dereuromark committed Oct 4, 2016
1 parent 64db8ce commit 51b141543cb446f39d50b1764527177feb32281a
Showing with 15 additions and 2 deletions.
  1. +15 −2 src/View/Helper/PaginatorHelper.php
@@ -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'],
@@ -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);
}
/**

0 comments on commit 51b1415

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