I want see image from database ,but I have erro, I only see name of image , Do you can help me?
?php $this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'idPhone',
'idNSX',
'Price',
'Date',
'Images',
),
)); ?>
Asgaroth
(Asgaroth Belem)
May 19, 2011, 3:54pm
2
Does your table saves the data in a blob field? whats your controller action to show the data? also please make a search in the forum, this question has been answered several times.
sorry , I searched in the fourum but there is not right in my case ,
my case is:
in file _view : I used code :
<?php echo CHtml::link( CHtml::image(Yii::app()->request->baseUrl."/images/".$data->HinhAnh,$data->HinhAnh,array('width'=>150,'height'=>190)), array('view', 'id'=>$data->MaDT)); ?>
in file view : only code
<?php $this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'MaDT',
'MaHangSX',
'Gia',
'NgayNhap',
'HinhAnh',
)
),
)); ?>
so I do not know how write code in file view ,you help me , thanks
Asgaroth
(Asgaroth Belem)
May 19, 2011, 4:53pm
4
You didn’t answer any of my questions, how am I suppose to help you?
kokomo
(Mwerlberger85)
May 20, 2011, 9:54am
5
The following wiki page should solve your problem
Saving files to a blob field in the database