Commit 1c1dcc2c by Carsten Brandt

fixed gridview documentation

fixes #4045
parent 6578cfbd
...@@ -122,11 +122,11 @@ grid columns. ...@@ -122,11 +122,11 @@ grid columns.
- `visible` is the column should be visible. - `visible` is the column should be visible.
- `content` allows you to pass a valid PHP callback that will return data for a row. The format is the following: - `content` allows you to pass a valid PHP callback that will return data for a row. The format is the following:
```php ```php
function ($model, $key, $index, $grid) { function ($model, $key, $index, $column) {
return 'a string'; return 'a string';
} }
``` ```
You may specify various container HTML options passing arrays to: You may specify various container HTML options passing arrays to:
......
...@@ -32,7 +32,8 @@ class Column extends Object ...@@ -32,7 +32,8 @@ class Column extends Object
*/ */
public $footer; public $footer;
/** /**
* @var callable * @var callable This is a callable that will be used to generated the content of each cell.
* The signature of the function should be the following: `function ($model, $key, $index, $column)`.
*/ */
public $content; public $content;
/** /**
...@@ -51,8 +52,8 @@ class Column extends Object ...@@ -51,8 +52,8 @@ class Column extends Object
public $headerOptions = []; public $headerOptions = [];
/** /**
* @var array|\Closure the HTML attributes for the data cell tag. This can either be an array of * @var array|\Closure the HTML attributes for the data cell tag. This can either be an array of
* attributes or an anonymous function that ([[Closure]]) that returns such an array. * attributes or an anonymous function ([[Closure]]) that returns such an array.
* The signature of the function should be the following: `function ($model, $key, $index, $gridView)`. * The signature of the function should be the following: `function ($model, $key, $index, $column)`.
* A function may be used to assign different attributes to different rows based on the data in that row. * A function may be used to assign different attributes to different rows based on the data in that row.
* *
* @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered. * @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
...@@ -69,6 +70,7 @@ class Column extends Object ...@@ -69,6 +70,7 @@ class Column extends Object
*/ */
public $filterOptions = []; public $filterOptions = [];
/** /**
* Renders the header cell. * Renders the header cell.
*/ */
......
...@@ -51,7 +51,7 @@ class DataColumn extends Column ...@@ -51,7 +51,7 @@ class DataColumn extends Column
public $label; public $label;
/** /**
* @var string|\Closure an anonymous function that returns the value to be displayed for every data model. * @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, $key, $index, $widget)`. * The signature of this function is `function ($model, $key, $index, $column)`.
* If this is not set, `$model[$attribute]` will be used to obtain the value. * 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. * You may also set this property to a string representing the attribute name to be displayed in this column.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment