Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
4e80dc54
Commit
4e80dc54
authored
Nov 16, 2013
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed hard dependency of Pagination -> web\Request
issue #1207
parent
f217948b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
Pagination.php
framework/yii/data/Pagination.php
+7
-2
ActiveDataProviderTest.php
tests/unit/framework/data/ActiveDataProviderTest.php
+0
-3
No files found.
framework/yii/data/Pagination.php
View file @
4e80dc54
...
...
@@ -9,6 +9,7 @@ namespace yii\data;
use
Yii
;
use
yii\base\Object
;
use
yii\web\Request
;
/**
* Pagination represents information relevant to pagination of data items.
...
...
@@ -131,7 +132,9 @@ class Pagination extends Object
public
function
getPage
(
$recalculate
=
false
)
{
if
(
$this
->
_page
===
null
||
$recalculate
)
{
$params
=
$this
->
params
===
null
?
Yii
::
$app
->
request
->
get
()
:
$this
->
params
;
if
((
$params
=
$this
->
params
)
===
null
)
{
$params
=
(
Yii
::
$app
->
request
instanceof
Request
)
?
Yii
::
$app
->
request
->
get
:
[];
}
if
(
isset
(
$params
[
$this
->
pageVar
])
&&
is_scalar
(
$params
[
$this
->
pageVar
]))
{
$this
->
_page
=
(
int
)
$params
[
$this
->
pageVar
]
-
1
;
if
(
$this
->
validatePage
)
{
...
...
@@ -169,7 +172,9 @@ class Pagination extends Object
*/
public
function
createUrl
(
$page
)
{
$params
=
$this
->
params
===
null
?
Yii
::
$app
->
request
->
get
()
:
$this
->
params
;
if
((
$params
=
$this
->
params
)
===
null
)
{
$params
=
(
Yii
::
$app
->
request
instanceof
Request
)
?
Yii
::
$app
->
request
->
get
:
[];
}
if
(
$page
>
0
||
$page
>=
0
&&
$this
->
forcePageVar
)
{
$params
[
$this
->
pageVar
]
=
$page
+
1
;
}
else
{
...
...
tests/unit/framework/data/ActiveDataProviderTest.php
View file @
4e80dc54
...
...
@@ -28,9 +28,6 @@ class ActiveDataProviderTest extends DatabaseTestCase
{
parent
::
setUp
();
ActiveRecord
::
$db
=
$this
->
getConnection
();
$this
->
mockApplication
([
'request'
=>
'yii\\web\\Request'
,
]);
}
public
function
testActiveQuery
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment