Help with syntax!!

I am trying to insert a link in a column of a cgridview. This link will lead to another cgridview based on an attribute value of the row in the 1st cgridview. I am having a parse error with a particular CHtml::link

Here’s is the code:





<?php $dataProvider=new CActiveDataProvider('Department'); ?>


<?php $this->widget('zii.widgets.grid.CGridView', array(


	'id'=>'department-grid',


	//'dataProvider'=>$dataProvider,

	'dataProvider'=>$model->search(),	


	'columns'=>array(


		'id',

		'name',

		array('name'=>'empname', 'type'=>'raw', 'value'=>'CHtml::link('Eyees', $this->createUrl('employee/admin'),array('id'=>'$data->id'))'),

		array(


			'class'=>'CButtonColumn',


		),


	),


)); ?>



Am I missing something? I’ve edited several times but without success :((

use like this, need class CLinkColumn




array(

            

        'class'=>'CLinkColumn',

        'labelExpression'=>'$data->name',

		'urlExpression'=>'Yii::app()->createUrl("/courses/exams/create",array("exam_group_id"=>$data->id,"id"=>$_REQUEST["id"]))',

        'header'=>'Name',

		'headerHtmlOptions'=>array('style'=>'color:#FF6600')

        ),



Thanks Rajith,

I’ll try it and get back to you. Hope it works: I’ve been wasting hours on this!

Hi Rajith,

Have not been able to make it work: parse error in syntax :angry:

http://blog.mbischof.de/anonyme-funktionen

It works!!!!!! I do not know how to thank you. I’ve wasted hours on this :-*

Bianca

PS Thanks to all of you who have tried to help me. This YII community is wonderful !!