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
mirunho
(D Mirecki)
2
Hi, please try:
array(
'name'=>'binaryfile',
'type'=>'raw',
'value'=>'[img]'.$this->createUrl.'[/img]',
),
no its not working it just displays
[color=#333333]"
"[/color]
mirunho
(D Mirecki)
4
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
mirunho
(D Mirecki)
6
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