Display Image In Detailed View

http://www.yiiframew…513#entry200513

i have seen this forum and topic and i want to add image from database in detailed view


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

	'data'=>$model,

	'attributes'=>array(

		'fileid',

		array(

				'name'=>'binaryfile',

				'value'=>'[img]'.$this->createUrl([/img]"',

				),

		'fileName',

		'fileType',

			'userName',

			array(

					'name' => 'gender',

					'value' => $model->gender == 1 ? 'male' : 'female',

			),

			

	),

)); 

but i got different its printed as text

Hi, please try:


                array(

                                'name'=>'binaryfile',

                                'type'=>'raw',

                                'value'=>'[img]'.$this->createUrl.'[/img]',

                                ),

no its not working it just displays

[color=#333333]""[/color]

You should try to use CHtml::image, it works for me:


        array(

            'name' => 'photo',

            'type' => 'raw',

            'value' => CHtml::image($this->createUrl('user/displaySavedImage', array('id' => $model->id)), 'alt'),

        ),

thank you so much and one more help how to change height and width sorry im newb to this

Height and width of image?

In this case you should use some php image Processing library to do this, please check out this link http://php.net/manual/en/book.image.php