Skip to content

Commit 51b1415

Browse files
committed
Add escape false to PaginationHelper
1 parent 64db8ce commit 51b1415

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/View/Helper/PaginatorHelper.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,16 +468,29 @@ public function sort($key, $title = null, array $options = [])
468468
/**
469469
* Merges passed URL options with current pagination state to generate a pagination URL.
470470
*
471+
* ### Options:
472+
*
473+
* - `escape`: If false, the URL will be returned unescaped, do only use if it is manually
474+
* escaped afterwards before being displayed.
475+
* - `fullBase`: If true, the full base URL will be prepended to the result
476+
*
471477
* @param array $options Pagination/URL options array
472478
* @param string|null $model Which model to paginate on
473-
* @param bool $full If true, the full base URL will be prepended to the result
479+
* @param bool $full If true, the full base URL will be prepended to the result @deprecated Use $options and `fullBase`.
474480
* @return string By default, returns a full pagination URL string for use in non-standard contexts (i.e. JavaScript)
475481
* @link http://book.cakephp.org/3.0/en/views/helpers/paginator.html#generating-pagination-urls
476482
*/
477483
public function generateUrl(array $options = [], $model = null, $full = false)
478484
{
479485
$paging = $this->params($model);
480486
$paging += ['page' => null, 'sort' => null, 'direction' => null, 'limit' => null];
487+
488+
$defaults = [
489+
'escape' => true,
490+
'fullBase' => $full
491+
];
492+
$options += $defaults;
493+
481494
$url = [
482495
'page' => $paging['page'],
483496
'limit' => $paging['limit'],
@@ -518,7 +531,7 @@ public function generateUrl(array $options = [], $model = null, $full = false)
518531
}
519532
}
520533

521-
return $this->Url->build($url, $full);
534+
return $this->Url->build($url, $options);
522535
}
523536

524537
/**

0 commit comments

Comments
 (0)