Is it possible to use IF statements inside the labelExpressionand urlExpression properties of CLinkColumn? I’ve tried and it doesn’t seem to work…
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$photoDataProvider,
'columns'=>array(
array(
'class'=>'CLinkColumn',
'header'=>'Set Active',
'labelExpression'=>'if ($data->isActive) echo ""; else echo "myLink";',
'urlExpression'=>'Yii::app()->createUrl("photo/activate",array("id"=>$data->ID))',
),
),
));