Skip to content

Commit

Permalink
Use 3rd param instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Oct 4, 2016
1 parent 51b1415 commit f4179e3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/View/Helper/PaginatorHelper.php
Expand Up @@ -468,28 +468,30 @@ public function sort($key, $title = null, array $options = [])
/**
* Merges passed URL options with current pagination state to generate a pagination URL.
*
* ### Options:
* ### 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 @deprecated Use $options and `fullBase`.
* @param array|bool $urlOptions Array of options or bool `fullBase` for BC reasons.
* @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)
public function generateUrl(array $options = [], $model = null, $urlOptions = false)
{
$paging = $this->params($model);
$paging += ['page' => null, 'sort' => null, 'direction' => null, 'limit' => null];

$defaults = [
if (!is_array($urlOptions)) {
$urlOptions = ['fullBase' => $urlOptions];
}
$urlOptions += [
'escape' => true,
'fullBase' => $full
'fullBase' => false
];
$options += $defaults;

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

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

/**
Expand Down

0 comments on commit f4179e3

Please sign in to comment.