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
1ae4103b
Commit
1ae4103b
authored
Nov 23, 2013
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed Sort::params to be retrieved from Request instead of $_GET
for consistency with paginiation
parent
454a9ee5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
Sort.php
framework/yii/data/Sort.php
+9
-2
No files found.
framework/yii/data/Sort.php
View file @
1ae4103b
...
...
@@ -12,6 +12,7 @@ use yii\base\InvalidConfigException;
use
yii\base\Object
;
use
yii\helpers\Html
;
use
yii\helpers\Inflector
;
use
yii\web\Request
;
/**
* Sort represents information relevant to sorting.
...
...
@@ -240,7 +241,10 @@ class Sort extends Object
{
if
(
$this
->
_attributeOrders
===
null
||
$recalculate
)
{
$this
->
_attributeOrders
=
[];
$params
=
$this
->
params
===
null
?
$_GET
:
$this
->
params
;
if
((
$params
=
$this
->
params
)
===
null
)
{
$request
=
Yii
::
$app
->
getRequest
();
$params
=
$request
instanceof
Request
?
$request
->
get
()
:
[];
}
if
(
isset
(
$params
[
$this
->
sortVar
])
&&
is_scalar
(
$params
[
$this
->
sortVar
]))
{
$attributes
=
explode
(
$this
->
separators
[
0
],
$params
[
$this
->
sortVar
]);
foreach
(
$attributes
as
$attribute
)
{
...
...
@@ -332,7 +336,10 @@ class Sort extends Object
*/
public
function
createUrl
(
$attribute
)
{
$params
=
$this
->
params
===
null
?
$_GET
:
$this
->
params
;
if
((
$params
=
$this
->
params
)
===
null
)
{
$request
=
Yii
::
$app
->
getRequest
();
$params
=
$request
instanceof
Request
?
$request
->
get
()
:
[];
}
$params
[
$this
->
sortVar
]
=
$this
->
createSortVar
(
$attribute
);
$route
=
$this
->
route
===
null
?
Yii
::
$app
->
controller
->
getRoute
()
:
$this
->
route
;
$urlManager
=
$this
->
urlManager
===
null
?
Yii
::
$app
->
getUrlManager
()
:
$this
->
urlManager
;
...
...
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