How To Add Width Tag In Cdetailview To Display Image

I can show image in the details view reading this here in Yii topic. Now, I want to add width and alt tag into img tag. Is it possible?

I wrote as follows:

$this->widget('zii.widgets.CDetailView', array(


'htmlOptions'=>array('class'=>'table table-striped responsive-table'),









        'alt'=>'hi images',

        'value'=> CHtml::image(Yii::app()->request->baseUrl.'/images/products/'.$model->image),





Thanks in advance.

You need to set them in the CHtml::image() call. The alt tag can be set in the second parameter and the width can be set in the third (htmlOptions) parameter.

thanks, I got it.