viewe images in yii admin


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



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,





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



You also can display image from any page as,


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




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…


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…



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