|
|
@@ -494,14 +494,20 @@ class PaginatorHelper extends Helper
|
|
|
*
|
|
|
* @param array $options Pagination/URL options array
|
|
|
* @param string|null $model Which model to paginate on
|
|
|
- * @param array|bool $urlOptions Array of options or bool `fullBase` for BC reasons.
|
|
|
+ * @param array $urlOptions Array of options
|
|
|
+ * The bool version of this argument is *deprecated* and will be removed in 4.0.0
|
|
|
* @return string By default, returns a full pagination URL string for use in non-standard contexts (i.e. JavaScript)
|
|
|
* @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#generating-pagination-urls
|
|
|
*/
|
|
|
- public function generateUrl(array $options = [], $model = null, $urlOptions = false)
|
|
|
+ public function generateUrl(array $options = [], $model = null, $urlOptions = [])
|
|
|
{
|
|
|
- if (!is_array($urlOptions)) {
|
|
|
+ if (is_bool($urlOptions)) {
|
|
|
$urlOptions = ['fullBase' => $urlOptions];
|
|
|
+ deprecationWarning(
|
|
|
+ 'Passing a boolean value as third argument into PaginatorHelper::generateUrl() is deprecated ' .
|
|
|
+ 'and will be removed in 4.0.0 . ' .
|
|
|
+ 'Pass an array instead.'
|
|
|
+ );
|
|
|
}
|
|
|
$urlOptions += [
|
|
|
'escape' => true,
|
|
|
@@ -1142,19 +1148,19 @@ class PaginatorHelper extends Helper
|
|
|
$links = [];
|
|
|
|
|
|
if ($options['prev'] && $this->hasPrev()) {
|
|
|
- $links[] = $this->Html->meta('prev', $this->generateUrl(['page' => $params['page'] - 1], null, true));
|
|
|
+ $links[] = $this->Html->meta('prev', $this->generateUrl(['page' => $params['page'] - 1], null, ['fullBase' => true]));
|
|
|
}
|
|
|
|
|
|
if ($options['next'] && $this->hasNext()) {
|
|
|
- $links[] = $this->Html->meta('next', $this->generateUrl(['page' => $params['page'] + 1], null, true));
|
|
|
+ $links[] = $this->Html->meta('next', $this->generateUrl(['page' => $params['page'] + 1], null, ['fullBase' => true]));
|
|
|
}
|
|
|
|
|
|
if ($options['first']) {
|
|
|
- $links[] = $this->Html->meta('first', $this->generateUrl(['page' => 1], null, true));
|
|
|
+ $links[] = $this->Html->meta('first', $this->generateUrl(['page' => 1], null, ['fullBase' => true]));
|
|
|
}
|
|
|
|
|
|
if ($options['last']) {
|
|
|
- $links[] = $this->Html->meta('last', $this->generateUrl(['page' => $params['pageCount']], null, true));
|
|
|
+ $links[] = $this->Html->meta('last', $this->generateUrl(['page' => $params['pageCount']], null, ['fullBase' => true]));
|
|
|
}
|
|
|
|
|
|
$out = implode($links);
|