I’m trying to communicate a GridView with a custom ActionColumn that prints row actions. I want to use the same ActionColumn class for all my grids in this project, but define wich buttons are shown in each grid.
I’ve added a parameter to column definition this way:
...
[
'class' => 'ounik\grid\ActionColumn',
'options' => ['template' => '{update} {delete} {statistics}']
]
...
And in initDefaultButtons method I’ve added this:
...
if(isset($this->options['template'])){
$this->template = $this->options['template'];
}
...
It works, but I don’t know if there’s a better method to communicate a GridView with a Column (I’m totally newbie with Yii)