CButtonColumnEx
- extended CButtonColumn, in which template and button options
can be php expressions.
-
Copy ButtonColumnEx directory to Yii
components
directory -
Add import path
'import'=>array(
...
'application.components.ButtonColumnEx.CButtonColumnEx',
...
)
- Use component in CGridView columns configuration
'columns'=>array(
...
array(
'class' => 'CButtonColumnEx',
'template' => '"{view}" . ($data->isCancelable() ? " / {cancel}" : "")',
'buttons' => array(
'cancel' => array(
...
'options' => array(
'data-title'=>'$data->title',
),
...
),
),
),
...
),