Yii CDetailView Tutorials

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(), ), array( 'name'=>'image_database', 'type'=>'raw', 'value'=>$model->showphoto_from_database(), ) ), )); ?> model.phpDisplay Image Only public function image_tag(){ return […]... Read More »