YM status On CGridView

I want to show the status of YM in CGridView, it would connect to the YM but his status can not be displayed, because the link status image is still not right. this my code.





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

        'id'=>'user-grid',

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

    'filter'=>$model,

    

               'columns'=>array(

            'class'=>'CLinkColumn',

            'header'=>Yii::t('ui','IDYM'),

    'imageUrl'=>'"http://opi.yahoo.com/online?u=".$data->profile->idyahoo',

            'labelExpression'=>'$data->profile->idyahoo',

            'urlExpression'=>'"ymsgr:sendim?".$data->profile->idyahoo',

            'htmlOptions'=>array('style'=>'text-align:center'),

),


                array(

                        'class'=>'CButtonColumn',

                ),

        ),

));  ?>




How to set the variable on its ImageUrl.

because with this code can not be on-off status.

any solution

Check the source for CLinkColumn::renderDataCellContent() - http://www.yiiframework.com/doc/api/1.1/CLinkColumn#renderDataCellContent-detail

The imageUrl cannot access row data by using $data as it’s not evaluated like urlExpression and labelExpression…

so the only solution for you would be to extend the CLinkColumn and add that evaluation…

can you help my to extend the CLinkColumn.

sory. newbie.

Actually… if you don’t need to use CLinkColumn… you can do it like this




array(

   'header'=>Yii::t('ui','IDYM'),

   'type'=>'raw',

   'value'=>'CHtml::link(

  	CHtml::image("http://opi.yahoo.com/online?u=".$data->profile->idyahoo),

  	"ymsgr:sendim?".$data->profile->idyahoo,

  	array("style"=>"text-align:center")

   )',

),



In the code above… the link/image is not centered in the table column…

to center use this




array(

   'header'=>Yii::t('ui','IDYM'),

   'type'=>'raw',

   'value'=>'CHtml::link(

  	CHtml::image("http://opi.yahoo.com/online?u=".$data->profile->idyahoo),

  	"ymsgr:sendim?".$data->profile->idyahoo

   )',

   'htmlOptions'=>array('style'=>'text-align:center'),

),



YES… SOLVED. :D Thank you mdomba for your attention