Problem creating custom buttons in CButtonColumn

Hi folks,

i read this article:

The author used the following code to create custom buttons for his CGridView CButtonColumn:







        'email' => array


            'label'=>'Send an e-mail to this user',


            'url'=>'Yii::app()->createUrl("users/email", array("id"=>$data->id))',


        'down' => array




            '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

Hi boehmi, welcome to the forum.

It sounds like the error might not be in the code that you quoted, but in other parts of your code for CGridView.

Make sure you will get no error when you have commented out those lines for CButtonColumn.