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
25b466d2
Commit
25b466d2
authored
Feb 13, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #2083: make sure keys of object type work with ActionColumn, GridView, etc.
parent
d445ab9d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
5 deletions
+4
-5
QueryBuilder.php
extensions/sphinx/QueryBuilder.php
+1
-2
ActionColumn.php
framework/grid/ActionColumn.php
+1
-1
GridView.php
framework/grid/GridView.php
+1
-1
ListView.php
framework/widgets/ListView.php
+1
-1
No files found.
extensions/sphinx/QueryBuilder.php
View file @
25b466d2
...
@@ -72,8 +72,7 @@ class QueryBuilder extends Object
...
@@ -72,8 +72,7 @@ class QueryBuilder extends Object
if
(
$from
===
null
&&
$query
instanceof
ActiveQuery
)
{
if
(
$from
===
null
&&
$query
instanceof
ActiveQuery
)
{
/** @var ActiveRecord $modelClass */
/** @var ActiveRecord $modelClass */
$modelClass
=
$query
->
modelClass
;
$modelClass
=
$query
->
modelClass
;
$tableName
=
$modelClass
::
indexName
();
$from
=
[
$modelClass
::
indexName
()];
$from
=
[
$tableName
];
}
}
$clauses
=
[
$clauses
=
[
...
...
framework/grid/ActionColumn.php
View file @
25b466d2
...
@@ -123,7 +123,7 @@ class ActionColumn extends Column
...
@@ -123,7 +123,7 @@ class ActionColumn extends Column
if
(
$this
->
urlCreator
instanceof
Closure
)
{
if
(
$this
->
urlCreator
instanceof
Closure
)
{
return
call_user_func
(
$this
->
urlCreator
,
$action
,
$model
,
$key
,
$index
);
return
call_user_func
(
$this
->
urlCreator
,
$action
,
$model
,
$key
,
$index
);
}
else
{
}
else
{
$params
=
is_array
(
$key
)
?
$key
:
[
'id'
=>
$key
];
$params
=
is_array
(
$key
)
?
$key
:
[
'id'
=>
(
string
)
$key
];
$route
=
$this
->
controller
?
$this
->
controller
.
'/'
.
$action
:
$action
;
$route
=
$this
->
controller
?
$this
->
controller
.
'/'
.
$action
:
$action
;
return
Yii
::
$app
->
controller
->
createUrl
(
$route
,
$params
);
return
Yii
::
$app
->
controller
->
createUrl
(
$route
,
$params
);
}
}
...
...
framework/grid/GridView.php
View file @
25b466d2
...
@@ -379,7 +379,7 @@ class GridView extends BaseListView
...
@@ -379,7 +379,7 @@ class GridView extends BaseListView
}
else
{
}
else
{
$options
=
$this
->
rowOptions
;
$options
=
$this
->
rowOptions
;
}
}
$options
[
'data-key'
]
=
is_array
(
$key
)
?
json_encode
(
$key
)
:
$key
;
$options
[
'data-key'
]
=
is_array
(
$key
)
?
json_encode
(
$key
)
:
(
string
)
$key
;
return
Html
::
tag
(
'tr'
,
implode
(
''
,
$cells
),
$options
);
return
Html
::
tag
(
'tr'
,
implode
(
''
,
$cells
),
$options
);
}
}
...
...
framework/widgets/ListView.php
View file @
25b466d2
...
@@ -98,7 +98,7 @@ class ListView extends BaseListView
...
@@ -98,7 +98,7 @@ class ListView extends BaseListView
$options
=
$this
->
itemOptions
;
$options
=
$this
->
itemOptions
;
$tag
=
ArrayHelper
::
remove
(
$options
,
'tag'
,
'div'
);
$tag
=
ArrayHelper
::
remove
(
$options
,
'tag'
,
'div'
);
if
(
$tag
!==
false
)
{
if
(
$tag
!==
false
)
{
$options
[
'data-key'
]
=
is_array
(
$key
)
?
json_encode
(
$key
)
:
$key
;
$options
[
'data-key'
]
=
is_array
(
$key
)
?
json_encode
(
$key
)
:
(
string
)
$key
;
return
Html
::
tag
(
$tag
,
$content
,
$options
);
return
Html
::
tag
(
$tag
,
$content
,
$options
);
}
else
{
}
else
{
return
$content
;
return
$content
;
...
...
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