viewe images in yii admin

Hi

I am new to yii framework. i have a problem in uploading images and dispalying them in the admin view. the text is display even uploaded image name is display but i want to show the images instead of image name how can it possible

kindly reply

thanks

Hi,

as you want to display photos in listing, i conclude that you use CGridView for listing.

here is working code to display images in listing from database path,


'columns'=>array(

	array(

        'name'=>'Image',

        'type'=>'html',

        'value'=>'CHtml::image("upload/photos/$data->photo_db_path", "", array("width"=>100))',

		'filter'=>'',

        ),

You also can display image from any page as,


<?php 

echo CHtml::image('upload/photos'.$model->photo_db_path,"image",array("width"=>275)); 

?>

Thankx…

Thanks

kiran sharma with your reply some problems solve but if u dont mind i have clear one thing in this code is

‘value’=>‘CHtml::image(“images/here how can i write image name dynamically”, “”, array(“width”=>80 , “height”=>60))’,

plz reply…

Hey,

as you see above code i specify $model->photo_db_path which the photo name comes from database which is present in your upload directory…

Thankx…

Hi

I have an problem on user management i Want to upload image in user when creting it sprofile and view image when user see his profile is it possible in yii

plaz replt thanks