Hi folks,
i read this article:
http://www.yiiframework.com/wiki/106/using-cbuttoncolumn-to-customize-buttons-in-cgridview/
The author used the following code to create custom buttons for his CGridView CButtonColumn:
array
(
'class'=>'CButtonColumn',
'template'=>'{email}{down}{delete}',
'buttons'=>array
(
'email' => array
(
'label'=>'Send an e-mail to this user',
'imageUrl'=>Yii::app()->request->baseUrl.'/images/email.png',
'url'=>'Yii::app()->createUrl("users/email", array("id"=>$data->id))',
),
'down' => array
(
'label'=>'[-]',
'url'=>'"#"',
'visible'=>'$data->score > 0',
'click'=>'function(){alert("Going down!");}',
),
),
),
But if i use the code i get an exception (yii/framework/zii/widgets/grid/CGridView.php(337)) saying
Looks like there’s something wrong with the template-string… also tried {email:foo:bar} and stuff, but didn’t work
I’m using yii 1.1.10.
Any ideas?
Thank you