Hi all,
I want to display blob images in my ‘image manage table’. But I don’t know how to do it… can anyone help me plz…
Hi all,
I want to display blob images in my ‘image manage table’. But I don’t know how to do it… can anyone help me plz…
This is my code in admin.php
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'image-table-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'image_id',
array(
'name'=>'image',
'type'=>'html',
'value'=>'(!empty($model->image))? <img src="model:image/png;base64,' . chunk_split(base64_encode($model->image)). '" /> ,"",array("style"=>"width:25px;height:25px;")):"no image"',
),
'image_url',
'image_phone_no',
'sub_menu_id',
array(
'class'=>'CButtonColumn',
),
),
)); ?>
It gives me an error.
I’m very new for yii. I’ll be very happy if any one can help me…
try it first with a harcoded bolb value for image source, if it works then your model blob value is incorrect, you’ve to check this. your cgrid view initialization is correct. try column type raw too.
Tried for that one also. but it is not work. .
Is there any other way for that?