Hi,
I have the following array in a CGridView:
array(
'header' => Yii::t('dataTable', 'Actions'),
'class' => 'CButtonColumn',
'template' => '{action}',
'buttons' => array(
'action' => array(
'label' => '$data["action"]["action"]',
'url' => function($data) use($paramsURI) {
$paramsURI['action'] = $data['action']['action'];
$paramsURI['id'] = $data['id'];
return Yii::app()->createUrl(
"admin/report/transactions", $paramsURI
);
}
)
)
)
I need to use the $data on button label, but in ‘label’ => ‘$data[“action”][“action”]’, $data is undefined, so I try to use a closure how in ‘action’, but the error is 'htmlspecialchars() expects parameter 1 to be string, object given '.
Any ideia how to resolve this?