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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
53e19304
Commit
53e19304
authored
May 22, 2014
by
MDMunir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add $key to function parameter
I think it's better to enclose `$key` as function parameter.
parent
41cddc7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
DataColumn.php
framework/grid/DataColumn.php
+2
-2
No files found.
framework/grid/DataColumn.php
View file @
53e19304
...
...
@@ -51,7 +51,7 @@ class DataColumn extends Column
public
$label
;
/**
* @var string|\Closure an anonymous function that returns the value to be displayed for every data model.
* The signature of this function is `function ($model, $index, $widget)`.
* The signature of this function is `function ($model, $
key, $
index, $widget)`.
* If this is not set, `$model[$attribute]` will be used to obtain the value.
*
* You may also set this property to a string representing the attribute name to be displayed in this column.
...
...
@@ -176,7 +176,7 @@ class DataColumn extends Column
if
(
is_string
(
$this
->
value
))
{
return
ArrayHelper
::
getValue
(
$model
,
$this
->
value
);
}
else
{
return
call_user_func
(
$this
->
value
,
$model
,
$index
,
$this
);
return
call_user_func
(
$this
->
value
,
$model
,
$
key
,
$
index
,
$this
);
}
}
elseif
(
$this
->
attribute
!==
null
)
{
return
ArrayHelper
::
getValue
(
$model
,
$this
->
attribute
);
...
...
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