Commit 02096038 by Carsten Brandt

added example to ActionColumn

parent 431d8864
......@@ -61,6 +61,17 @@ class ActionColumn extends Column
*
* where `$url` is the URL that the column creates for the button, and `$model` is the model object
* being rendered for the current row.
*
* You can add further conditions to the button, for example only display it, when the model is
* editable (here assuming you have a status field that indicates that):
*
* ```php
* [
* 'update' => function ($url, $model) {
* return $model->status == 'editable' ? Html::a('Update', $url) : '';
* };
* ],
* ```
*/
public $buttons = [];
/**
......@@ -70,6 +81,7 @@ class ActionColumn extends Column
*/
public $urlCreator;
/**
* @inheritdoc
*/
......
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