How do I not encode html in CGridView columns

I’ve seen the answer to this somewhere in the api doc but can’t for the life of me find it. I want to render an <img> tag in a column. I think you specify it in the htmlOptions attribute but I’ve tried this with;


…but that don’t work…

i´m not sure, but try this:


'columns' => array(








There wasn’t any reply to the suggestion, so I thought I would (even though it’s been a while). Setting the type to raw did, in fact, do the trick. I had the same issue, and I came across this post, so I wanted to confirm the solution and say “thanks” to Flavio. :)

try this out htmlOptions=>(‘encode’=>0)


array( ‘encode’=>0, ‘class’=>‘icon liked tips’, ‘aria-hidden’=>‘true’,



This seems to work:

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





		'property1',  // property1 will be HTML-encoded




                    ),                // property2 will not be HTML-encoded






)); ?>