Displaying an image in CDataColumn

I’m supplying an img tag as the value of a data cell in a grid view but it encodes the characters and as a result shows a rendition of code. I’ve tried setting htmlOptions encode=>false but it still encodes the contents. Is there a way around this?


I used the ‘type’ attribute and set it to ‘image’



Thanks :)

I did it with

'type' => 'html'


'value' => 'CHtml::image($data->smallLogoUrl, "logo")'

could you explain it with more details plz?

my case :

I have a column where I can have 3 value. And I want associate each value with an image.

so I Try to change the type of my column, (for example with image, and put the name of my jpg as the value but nothing appear.)


array('name' => 'Statut', 'header'=>'Statut', 'type'=>'image'), ...

and in my value, I recieve 1.jpg from my database. (or if the name of the jpg is not needed it can be the real status name.)

thx for your help

edit it’s ok I found. I made a getImgUrl in my model which give the url of the image depending of my status.

this get function is call in my value column. so I keep my Name column for the search and the sort. thx.