Tag Archives: Yii Image

How to display image in CDetailView Yii Framework 1.0

This tutorial will help you to display the image in CDetailview widget of yii framework 1.0. We added a different funcitons in model.php to display the image with different methods like only image, image with link, image from database etc. View.php <?php $this->widget(‘zii.widgets.CDetailView’, array( ‘data’=>$model, ‘attributes’=>array( array( ‘name’=>’image’, ‘type’=>’raw’, ‘value’=>$model->image_tag(), ), array( ‘name’=>’imagelink’, ‘type’=>’raw’, ‘value’=>$model->image_with_link(), […]

Yii 1.0 Display Image Form Database

Before save the image into database, i created one ‘text’ field in mysql table to save the image code. We can show the image in CDetailview from database table of yii framework. Here i used showphoto_from_database() function to display the image from database. showproof_from_image_folder() is used to fetch uploaded image url from database and display. […]