Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions framework/yii/data/Pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Pagination extends Object
public $route;
/**
* @var array parameters (name => value) that should be used to obtain the current page number
* and to create new pagination URLs. If not set, $_GET will be used instead.
* and to create new pagination URLs. If not set, all parameters from $_GET will be used instead.
*
* The array element indexed by [[pageVar]] is considered to be the current page number.
* If the element does not exist, the current page number is considered 0.
Expand Down Expand Up @@ -131,7 +131,7 @@ public function getPageCount()
public function getPage($recalculate = false)
{
if ($this->_page === null || $recalculate) {
$params = $this->params === null ? $_GET : $this->params;
$params = $this->params === null ? Yii::$app->request->get() : $this->params;
if (isset($params[$this->pageVar]) && is_scalar($params[$this->pageVar])) {
$this->_page = (int)$params[$this->pageVar] - 1;
if ($this->validatePage) {
Expand Down Expand Up @@ -169,7 +169,7 @@ public function setPage($value)
*/
public function createUrl($page)
{
$params = $this->params === null ? $_GET : $this->params;
$params = $this->params === null ? Yii::$app->request->get() : $this->params;
if ($page > 0 || $page >= 0 && $this->forcePageVar) {
$params[$this->pageVar] = $page + 1;
} else {
Expand Down